So if i have:

NSMutableString *title = [[NSString alloc] init];
[title setString: @"test"];

That would be correct and safe?

Thank!!
John



No. I hope it would emit warnings on compilation too. That would set title to an NSString instance, then you go calling setString: on it and that's an NSMutableString member function, so it would crash with an unimplemented selector.

If you want title to be an NSMutableString* then you need to alloc and init an NSMutableString for it.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to