confused (seriously, what else is new?)... correct me if (where) i'm wrong:

-=-=-=-=-
-(void)myMethod
{
NSString *foo = [[NSString alloc] initWithFormat:@"bar"];
NSLog(foo);
}
-=-=-=-=-

"new", "alloc", initWithFormat" (or "stringWithFormat") are class
factory methods that are declared methods inherited by my custom
classes, i guess somewhere in NSObject?

so it write a stringWIthFormat class method, i guess to override it
for the custome class it's written within:

-=-=-=-=-
+ (NSString *)stringWithFormat
{
return @"newBar";
}
-=-=-=-=-

assuming both these methods are written in the same custom class, does
that mean that my first method "(void)myMethod" will not allocate and
initiate a new stringWithFormat of @"bar" and output it to the console
with NSLog(), but will output @"newBar" to the console?
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to