Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (id)init
- {
- self = [super init];
- if (self)
- {
- //do some initialisations
- }
- return self;
- }
- + (id)new
- {
- id object = [super new];
- if (object)
- {
- //do some initialisations
- }
- return object;
- }
- + (id)new
- {
- return [[self alloc] init;
- }
- - (id) init
- {
- // init code
- }
- - (id) initWithName:(NSString *)name
- {
- // init code
- }
- + (id) personWithName:(NSString *)name
- {
- // add autorelease on non-ARC
- return [[super alloc] initWithName:name];
- }
- Person *person = [Person personWithName:@"Steve Jobs"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement