KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is this code correct @implementation Vehicle +(id) vehicleWithColor:(NSColor*)color { id newInstance = [[[self class] alloc] init]; // PERFECT, the class is // dynamically identified [newInstance setColor:color]; return [newInstance autorelease]; } @end Why use [self class] I thought self already points to the class on static methods (the ones with +)
Tags (comma-separated)
Save Edits
Cancel