Thursday, May 24, 2012

Unit test with NSBundle


When the unit test harness runs your code, your unit test bundle is NOT the main bundle. Your code is searching the wrong bundle. If you replace the above line with:
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *path = [bundle pathForResource:@"foo" ofType:@"txt"];
Then everything will be fine.

Wednesday, May 23, 2012

An easy option to backup your application data

I have been searching a good way to back up application data by user. You may use iCould, that's for iOS 5 and later. Or you can use DropBox, that one is easy and flexible, but you force user to get a dropbox account.

Today I found an easy way, user can do it menully,  backup through iTune file sharing.

http://support.apple.com/kb/HT4094

Simply put this key in your plist file will do the magic, no code required.


UIFileSharingEnabled