iOS SDK Findings
My daily findings working with the iOS SDK
Tuesday, December 21, 2010
Localizing images
Saturday, December 18, 2010
Super fast way of integrating Twitter into your app
NSString *stringURL = @"twitter://post?message=check out this cool lifestyle app http://itunes.com/apps/wayoflife";
NSString *escapedStringURL = [stringURL stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]
NSURL *url = [NSURL URLWithString:escapedStringURL];
[[UIApplication sharedApplication] openURL:url];
----
Of course it requires that the user has Twitter installed on his/her phone to handle this URL.
Friday, December 17, 2010
Loading localized strings into an NSDictionary
Get the path to the strings file.
NSString *pathToFile = [[NSBundle mainBundle] pathForResource:@"Localizable" ofType:@"strings"];
pathToFile now points to the correct localization of the Localizable.strings according to user prefs.
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile: pathToFile];