Re: NSString and NSMutableString
Re: NSString and NSMutableString
- Subject: Re: NSString and NSMutableString
- From: Nat Lanza <email@hidden>
- Date: Sat, 14 Apr 2007 21:29:56 -0400
Michael Novak wrote:
NSString *beginURL = @"http://www.google.com/search?hl=en&q=";
NSMutableString *searchQuery;
[searchQuery setString:[searchField stringValue]];
It's possible that this is just something left out of the excerpt you
sent, but I don't see where you're actually allocating an
NSMutableString object here -- you're just declaring a pointer and
sending messages to whatever that address on the stack happened to point to.
Try something like this instead:
NSMutableString *searchQuery = [[searchField stringValue] mutableCopy];
Then you'll of course need to release the object when done with it, or
autorelease it, etc, etc.
--nat
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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