• Broken Xcode 4 project templates

    The other day I received a crash report from one of my projects that included a symbolicated crash log. This was very strange as I've never received a symbolicated crash log for an iOS project; I've always had to match it up with the dSYM file that I've stored away. After a little research, I found that some settings in the project didn't strip out the debug symbols. I found an older article on Apple's developer site that seemed to address this. I flipped on the switches and the project size dropped by 500K which would make sense.

    The next step was to see how I missed these switches. The default Xcode 4 template for an iOS navigation based app has the following:

    STRIP_INSTALLED_PRODUCT = YES
    

    for the release build. However, the article above indicates that the following flag must also be on for the above one to have any effect.

    Xcode provides several built-in options for stripping executables of their debugging symbols. One of these is the Strip Linked Product build setting. While typically set, it has no effect unless the Deployment Postprocessing setting is also set. Deployment Postprocessing is a master switch that enables the action of a host of other build settings. It's approximately analogous to running the xcodebuild tool with the install command.

    DEPLOYMENT_POSTPROCESSING = YES
    

    Unfortunately it's a bit hard to test with a basic project as the file size is too small. However, I opened the CTPageViewer sample app and tested with DEPLOYMENT_POSTPROCESSING on and off and with it off, the file size was definitely larger indicating that the flag must be set to YES.

    So, did Apple mess up the default project? If you have your own template (which I might cover in another most), you can change the settings. If Apple didn't mess up, what am I missing?

  • The end of a long (banking) relationship

    Almost 20 years ago, I opened a bank account with Security Pacific right before I started college. Security Pacific merged with (the now) Bank of America while I was still in college, so I became a Bank of America customer. I continuously had an account with Bank of America since then, but last year I moved all of my accounts as my free account was going away (it was tied to my mortgage that I moved). I hung onto a free account to keep the ability to have a safe deposit box there.

    The other day I received a letter from Bank of America saying that my free account would cost $12 per month unless I kept a minimum balance of $1500, something that I have no interest in doing as I already moved my funds somewhere else. My choices of finding a bank with a free account in order to have a safe deposit box are pretty limited, unfortunately. My current bank doesn't offer safe deposit boxes (in fact only has 1 financial center in the county, but will be adding another that will just be a financial center). I've heard ads for San Diego County Credit Union on the radio all the time, so I decided to take a look. All they require is a $50 opening balance for a savings account with no monthly fee. In addition, the safe deposit box prices are lower than Bank of America. The only downside to this switch is the location isn't as convenient as the Bank of America down the street (it now will take me about 10 minutes to drive to my box).

    Next week I'll be closing out my Bank of America account and ending almost 20 years dealing with them. Of course, no one cares about it, but it seems to me that companies would make some effort to keep customers instead of driving them away with fee after fee after fee. Our tax dollars helped bail out banks and they repay us customers by charging us more. While I'm just starting with a safe deposit box at the credit union, who knows what the future may bring. Their auto loan rates are pretty good and I'd consider a mortgage with them if the rates are good.

  • Artistic picture taken by a 4 year old

    As I was working today, me Eye-Fi app downloaded some pictures that my son was taking in the other room. I saw one of them and was quite impressed by the composure of the picture. While I'm sure my son had no idea what he was doing, I thought it was cool.

    IMG 3680

  • Failure to check return Location Manager values

    Last night I downloaded the Bing for iPad app and it looks quite interesting. However, I ran into a problem that shows a failure for the developers to properly handle an error condition. I told it to use my current location and it said I was over 500 miles away from my home. The location was where I was a few weeks ago. I switched to the Maps app and that app said it was unable to determine the location. A quick device reset fixed everything including Bing, but the fact that Bing didn't know where I was got me thinking about what caused it. (My WiFi router is registered with Skyhook, so my iPad will always return my house's location when it asks for the location if I'm home.)

    I've worked a lot with CLLocationManager and have found some quirks with it. First, sometimes it never returns a value, so developers must set a timer and alert the user. This, however, was not the problem in the Bing app. When the app requests the location, it does something like:

        self.manager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
    

    which means it only needs to be accurate within 3 km. As the CLLocationManager updates its location using:

    - (void)locationManager:(CLLocationManager *)inManager
     didUpdateToLocation:(CLLocation *)newLocation
     fromLocation:(CLLocation *)oldLocation
    {
     	if (newLocation.horizontalAccuracy >= 0.0 &&
              newLocation.horizontalAccuracy <= 10000.0)
    	{
    	}
    }
    

    it needs to check the horizontalAccuracy to make sure it is positive and within the desired range. I believe that the Bing app isn't properly checking this and just taking the value that is immediately returned. Since CLLocationManager caches the last location for efficiency, it is instantly returned. This is the wrong thing to do without checking the result.