20 Nov 2009, 3:28am

leave a comment

Used up your quota of 5 iTunes Authorized computers?

Don’t fret… you can reset the count once every 12 months.

13 Nov 2009, 7:44pm

3 comments

dSYM Archive Script

Archiving dSYM for production builds is a good idea.

An easy way to do it is to add a build script at the end of your build.

in XCode->Targets->YourBuildName
right click, and select Add -> New Build Phase -> New Run Script Build Phase

and copy in this script. ArchiveDSYMScript

Repeat for all targets. Ensure the order is after the ‘Link Binary With Libaries’ task.

NB. This excludes “Debug” and “Release” build types, as I use “Distribution” and “Distribution Ad-Hoc” for my distribution builds. Easy to change, if you need.

13 Nov 2009, 7:30pm

leave a comment

[: too many arguments

If you get the error “[: too many arguments" in your bash script - check that you have wrapped your variables with quotes.

if [ $X = "y"]

will cause this error if $X is a string with a space in it. Change to :

if [ "$X" = "y"]

13 Nov 2009, 6:46pm

1 comment

Analysing iPhone Crash Dumps (OS 3.0)

If you are sent a crash dump by the Approval Team, download it through iTunes Connect or some other way you need to be able to interpret them into something usable. Here’s how:

Run
/Developer//Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash xxxx_2009-11-12-140756_iPhone.crash > crash_with_symbols.txt

This is the difference in knowing the exact line of code that crashed, and knowing it crashed. Make sure your have your dSYM files though – read on.

Useful options for the script are -v (verbose) and -A (just search for Application symbols).

HOWEVER: You MUST keep the dSYM file for every build you do. Even doing a rebuild off the exact same source code produces a dSYM file that is not compatible with the script. So archive those dSYMs!!!

Check out my automatic dSYM script here: dSYM Archive Script

2 Nov 2009, 5:08pm

14 comments

MKDotBounceAnimation animationDidStop bug

MKMapViews seem buggy when created problematically.

Some tips:

  1. set the delegate to nil when the delegate dealloc’s, as per that advice to fix one of the crashbugs
  2. Either make the instance it static so you never release it, or schedule a delayed ‘release’ command to avoid theanimationDidStop crashbug.

What I do to avoid theanimationDidStop crash is instead of calling release directly, I call it after a delay of 4 seconds. This is easy with this statement:

 [mapView performSelector:@selector(release) withObject:nil afterDelay:4.0f];

Just gives the internal stuff a chance to clean itself up before the release is sent.

EDIT: if you read the comments below, there are some even better workarounds. Jayant offers this approach which is much cleaner:

[mapView.layer removeAllAnimations];

It seems this MKDotBounceAnimation problem only occurs with problematically created MKMapViews (not XIB ones), as my XIB one never seems to crash with that error.

PS. I’m the author of the app GPS Log, please check it out :)