Re: Re Re: String variables in classes
Re: Re Re: String variables in classes
- Subject: Re: Re Re: String variables in classes
- From: Charles Srstka <email@hidden>
- Date: Sun, 2 Jan 2011 18:30:27 -0600
On Jan 2, 2011, at 6:10 PM, Stephen J. Butler wrote:
> - Charles asks 'why the @""' and I can answer that question: because
> you couldn't figure out another way to call stringByAppendingFormat:
> could you? The answer is that in this case you should be calling
> +[NSString stringWithFormat:]. However...
Ah — my assumption was that he wanted to keep appending previous results to the string, so it’d create sort of a log file sort of thing (or, since his object is a calculator, something akin to a roll of tape on an adding machine). In this case, using -stringByAppendingString: (or just using an NSMutableString) would be correct, although the assignment to an empty string would be wrong.
Charles_______________________________________________
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