Wednesday, January 25, 2012

Adding a NIB view at runtime


// Add MyView.xib to a UIView, in IB associate MyView.xib and the MyView class
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil];        
MyView* o = [nibViews objectAtIndex:0];
[self addSubview:o];

Wednesday, January 18, 2012

Showing invisible files and folders on the Mac

In Terminal:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder




to hide:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

Thursday, January 5, 2012

Xcode 4.2 doesn't generate a stack trace

Xcode 4.2 doesn't generate a stack trace when simulating iOS5. Choosing a 4.x (or older) target in the project's scheme menu will show a stack trace. The project build setting for 'iOS Deployment Target' has to be set to 4.x (or older) to see older scheme targets.

Wednesday, December 28, 2011

Converting Mac sound files using command line


This can be used for lots of sound types:

    afconvert -f caff -d LEI16 slide.mp3 slide.caf

For more info: Good article, Apple Docs

Saturday, December 17, 2011

Aborting commit: '...' remains in conflict


svn remove --force filenameOrDir
svn resolve --accept=working  filenameOrDir
svn commit

Thursday, December 1, 2011

Xcode 4.2 and iOS 4.2.1

Been getting reports of users with second generation iPod Touch running iOS 4.2.1 having layout and image issues. An Apple employee posted:

The most recent LLVM Compiler has a bug wherein armv6 code that uses CGPoint and CGRect structs can be optimized incorrectly. As a workaround, try compiling your armv6 code with "Compile for Thumb" set to No (or add -mno-thumb to your Other Compiler Flags).

I think this is how you turn off thumb using project settings:


I'll give this a shot and report back.

Update: I got a hold of an iPod Touch 2g running iOS 4.2.1 and found that the change to the optimization setting does indeed fix the issue. Backing out the change reproduced the errors. Whew.

Tuesday, November 29, 2011

Google Analytics and iOS

Using Google Analytics to monitor how user's interact with iPhone and iPad apps has been enlightening. Google makes it easy to create a dashboard to quickly grok how an app is being used. It's very easy implement, just add a line of code anywhere you want to record an event. It hasn't introduced any issues (e.g. memory, app approval) in the three apps I've shipped it with. You can create unique web based dashboards for each app you wish to monitor.

Google's latest beta lets you monitor apps in real time - this is SO cool. You can see how many people are currently using an app, where they are in the app, if they are new or returning, and monitor page views in real time. Google provides a map of the world that shows each time a user starts using your app, you can even use Google Earth to spin the globe and highlight the location of each time a user starts to use your app. Some locations have a lot more users than sales, but that's another issue...