@Paul Maddox #
Posted Wednesday 29th April 2009 13:38 GMT
Erm, it's not a blog post it's a development article posted in the Software->Developer section.
Posted Wednesday 29th April 2009 09:58 GMT
How does this qualify as "Sci/Tech News for the World"? It doesn't even qualify as a particularly interesting blog post.
Posted Wednesday 29th April 2009 13:38 GMT
Erm, it's not a blog post it's a development article posted in the Software->Developer section.
Posted Wednesday 29th April 2009 20:57 GMT
You can get the same thing by using the NSLocalizedStringFromTableInBundle() function, declared in Foundation. Following the example in the post, the call would look like:
NSString* cancelString = NSLocalizedStringFromTableInBundle(@"Cancel", @"Preferences", [NSBundle bundleWithIdentifier:@"com.apple.AppKit"], nil);
You can also do this same trick with any framework that has .strings resources like AppKit has, just substitute the identifier of the framework for @"com.apple.AppKit".
Posted Thursday 30th April 2009 19:43 GMT
Thanks for that, Brian - interesting. Given the example code you provide, it's easy to see why the Apple developers came up with a more succinct way of doing things. ;-)
Incidentally, _NXKitString is just a wrapper around [NSBundle localizedStringForKey:value:table:], using another undocumented routine to retrieve the bundle instance for AppKit.
Dave