Skip to content

Instantly share code, notes, and snippets.

David Brown ddb

Block or report user

Report or block ddb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ddb / main.m
Created Jun 23, 2011
If you need regional language localization, this change to main.m will enable iOS to pick the correct regionally localized resources.
View main.m
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 / XCObject.h
Created Feb 13, 2011
a declaration of the types used in an Xcode project file.
View XCObject.h
// XCObject.h
// XcodeProj
// Created by David Brown on 2/13/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
#import <Foundation/Foundation.h>
View entity.m
// ObjCEntity.m
// Entity
// Created by dbrown on 2/10/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
#import "ObjCEntity.h"
ddb / foo.m
Created Feb 10, 2011
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.
View foo.m
@interface WebServiceHelper : NSObject {
+(NSURLRequest *) generateWebServiceURLRequest : (NSString *) url: (NSString *) methodName: (NSArray *) keys: (NSArray *) objects;
+(NSURL *) generateWebServiceHTTPGetURL : (NSString *) url: (NSString *) methodName: (NSArray *) keys: (NSArray *) objects;
You can’t perform that action at this time.