MKDotBounceAnimation animationDidStop bug
MKMapViews seem buggy when created problematically.
Some tips:
- set the delegate to nil when the delegate dealloc’s, as per that advice to fix one of the crashbugs
- 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 programmatically 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 :)
wow, OS X
OS X really makes setting up a LAMP service dead easy. I need to do some offline dev (and lets face it, I’m very sick of uploading over slow connections).
Apache and PHP are installed out of the box. Yep – installed *by default* on everyone’s OS X install, not just developers. This is used for the web-sharing feature.
But you have to change one line in Apache to enable the PHP module. This doc was useful (I used vi for everything though, of course). Or the apple docs which make it look harder than it actually is.
Installing MySQL is as simple as downloading the DMG from MySQL.com and running the installer.
And that is is. No ./configure, no make, no make install. Just tweak some settings, and run an installer.
Love it!
iPhone Design Stuff
This is a really useful App Icon template. Thanks Dustin!
A list of sweet app websites (mine’s not in the list, no surprise there :`( )
A really sweet tutorial on creating an awesome App website
Some common App design mistakes.
And this cool conversion app. I just bought it, even though I have a units converter already, and a currency converter which does a better job than this app (displaying all the currencies at once), it was just too damn slick to resist. Wish I could make videos like theirs. And thanks for the 3.0 adoption info! That encourages me for when I go 3.0-only next month (I was worried to lose sales, but maybe this won’t happen).
Also, creating beveled buttons, iPhone PSD mocup toolbox and this guy is just damn awesome.
All from a single google query !!! not bad, not bad at all. I feel like some tea.
Wikipedia external link icon
I needed the external link icon from Wikipedia for an App – but I wanted to resize it.
Fortunately, they offer it in .svg format, and copyright free.
http://commons.wikimedia.org/wiki/File:External.svg
Creating UITableViewCell’s from NIB’s
The guts of it is (slightly modified for my own needs):
CustomTableCell *customCell = (CustomTableCell *)[self.tableView dequeueReusableCellWithIdentifier:@"CustomTableCell"];
if (customCell == nil) {
CGRect startingRect = CGRectMake(0.0, 0.0, 320.0, ROW_HEIGHT);
 customCell= [[[CustomTableCell alloc] initWithFrame:startingRect reuseIdentifier:@"CustomTableCell"] autorelease];
[[NSBundle mainBundle] loadNibNamed:@"CustomTableCellNIB" owner:customCell options:nil];
[customCell loadContent];
}
return customCell;
In loadContent I basically go: [self.contentView addSubview:cellContentView]; where cellContentView is my IBOutlet UIView* cellContentView;
Easy…
Calling UIAlerts from a separate thread
If you show a UIAlert from a separate thread, you may get a _WebThreadAutoLock exception, especially if that alert contains a lot of text (which changes the UIAlert to have a scrolled text field).
To fix it’s easy, simply change where you had:
to
[alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];
That will run the alert on the main thread. You can also [release] the alert instance immediately, as the scheduler retains it for you.
Extracting data from the iPhone Simulator
I wrote earlier about extracting data from the iPhone backup – something very useful for backup & debugging purposes.
Developers can also access the Simulator’s data, and no extraction is needed:
~/Library/Application\ Support/iPhone\ Simulator/User/Applications/
(~ is unix shorthand for /Users/yourusername)
The cool thing is that because no extraction is needed you can even edit the data in-place, e.g. using sqlite3. And, you can copy your live data from your iPhone (extracted as per these instructions) right over the simulator data. Very handy indeed for GPS Log!
Neat.
If you have lots of sample apps it may be hard to find which is yours, use grep to filter the list with the current day, then there’s at least less to wade through. Chances are the directory with the most recent timestamp is your app.
ls -la | grep “21 Jun”
GPS Log – Price Tag
iPhone users really have come to expect a bargain. Odd considering how much cash they forked out for the phone. But so many people discounting their Apps in a desperate bid for popularity (it’s based on downloads, not downloads * price, which encourages $1 apps), the prices are generally undervalued (that – and there’s a lot of crap on the App Store).
I’ve had 2 people now review the free version of GPS Log (albiet with overall positive reviews) asking for a lower price. But it’s only $10. I’m trying to think of computer software I have bought for less than that, and I can’t. I’ve bought a dozen small utilities over the years, from screen capture tools, to newsgroup software, all in the $25 range (sometimes US).
lwb@sg writes, “Excellent GPS software. It’s easily one of the best geotagged-related programs I have tried on iPhone. If the full version is more reasonably priced, I would not hestitate to get it!”
So it’s better than all those other shitty apps. But it costs more than them.
hmm. lets think about that for a minute.
It’s better. But it costs more. That’s because it’s better! Maybe if those other devlopers were working on their apps full time they would be better too – but then they would also want more money, because hey – you have to pay for the food you eat!
So I don’t get it people. Reward quality with purchases, and you will encourage more quality. Set the bar at $1 and expect 8 pages of crap on your iPhone.
The thing is that you can’t make up for the low price with volume, unless your App has mass appeal. If GPS Log was $1 I would have the same number of people interested – but perhaps a small fraction extra would buy it because they are unwilling at the current price. But I would need 10x more purchases to make up for this! I know GPS Log doesn’t have mass appeal – I never intended it to – I want it to appeal to a small group of users who need the extact features it provides (such as me), and thus are willing to pay $10 for the privilage. So far this seem to be working.
I’m asking for $10 – and I’m keeping it that way.
Distributing Ad-hoc Apps
This website has a very good summary. It’s a little old now though – so I read it at the same time as the ‘Program Portal’ instructions (using the latter, when possible).
This is a really useful free app for getting UDID’s from your users (beta testers, translaters, whatever).
To create the distribution ad-hoc build, follow the instructions in the Developer Portal.
To make a windows compatiable ad-hoc build version, drag the application bundle into iTunes, then create a zip from the IPA that that action creates. I use iTunes on a separate user account to avoid polluting my main one and mixing the dev and ad-hoc builds. Then give your windows users the IPA. The Windows iTunes is a lot less forgiving and can’t load the bundles directly. More tips are here.
if ( someVar = nil )
heh, so the iPhone SDK doesn’t even warn if you accidentally have an assign statement in an if. You’ve been warned!
