XCode const warnings
XCode const warnings
- Subject: XCode const warnings
- From: Darrin Cardani <email@hidden>
- Date: Fri, 13 Feb 2004 09:57:20 -0600
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*'
I guess the compiler's right, but since it requires an NSString
instead of an NSMutableString, it shouldn't make any difference,
should it? I can cast away the const-ness, but I just want to make
sure that's not going to cause any problems. Is it? I have a couple
dozen of these warnings. Should I be avoiding using NSStrings as
constants, and instead just make them regular globals?
I also get a similar problem when putting these constant strings into
NSDictionaries. I get:
invalid conversion from `const NSString*' to `obc_object*'.
I just want to make sure whatever I do is safe. Any suggestions would
be appreciated.
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<
http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
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.