Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ddb
ddb / main.m
Created June 23, 2011 15:37
If you need regional language localization, this change to main.m will enable iOS to pick the correct regionally localized resources.
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
NSString *locale = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
NSString *dashed = [NSString stringWithFormat:@"%@-%@", language, locale];
NSString *underlined = [NSString stringWithFormat:@"%@_%@", language, locale];
@ddb
ddb / XCObject.h
Created February 13, 2011 07:30
a declaration of the types used in an Xcode project file.
//
// XCObject.h
// XcodeProj
//
// Created by David Brown on 2/13/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
//
// ObjCEntity.m
// Entity
//
// Created by dbrown on 2/10/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "ObjCEntity.h"
@ddb
ddb / foo.m
Created February 10, 2011 17:16
These method declarations make my head hurt. These are from a sample project for an app that just showed up in the dev tools section of the mac app store -- note that you can use bare colons in method names. I did not know that.
@interface WebServiceHelper : NSObject {
}
+(NSURLRequest *) generateWebServiceURLRequest : (NSString *) url: (NSString *) methodName: (NSArray *) keys: (NSArray *) objects;
+(NSURL *) generateWebServiceHTTPGetURL : (NSString *) url: (NSString *) methodName: (NSArray *) keys: (NSArray *) objects;
@end