Re: XCode const warnings
Re: XCode const warnings
- Subject: Re: XCode const warnings
- From: Jim Correia <email@hidden>
- Date: Fri, 13 Feb 2004 11:32:51 -0500
On Feb 13, 2004, at 10:57 AM, Darrin Cardani wrote:
I have a project I've been building with Project Builder. I recently
moved the project to XCode and am now getting some warnings I wasn't
getting with PB. For example, I'm calling NSMutableString's
replaceOccurrencesOfString:withString:options:range method. The
"withString" parameter I'm passing is declared as:
const NSString* myString = @"blah";
So I'm getting the warning:
invalid conversion from `const NSString*' to `NSString*'
NSString is already immutable, so you don't gain anything from making
it a const pointer.
What you might want to do is make sure that no one reassigns myString
to something else, so you'd write
NSString * const myString = @"blah";
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.