Re: Performance, Efficiency - Coding practice
Re: Performance, Efficiency - Coding practice
- Subject: Re: Performance, Efficiency - Coding practice
- From: Roland King <email@hidden>
- Date: Fri, 29 May 2009 08:57:00 +0800
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 (email@hidden)
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:
This email sent to email@hidden