stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
09/28/12 04:33 PM (13 years ago)

using stringwithstring with a literal is redundant

Upgraded to latest xcode and have been getting lots of non-critical errors. Some i've been ablt to fix looking through the forum. One I haven't found is the following. I have a line, such as this: [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name="command" "] dataUsingEncoding:NSUTF8StringEncoding]]; And I get the error using "stringwithstring" with a literal is redundant. It doens't cause a crash but still I like the code to be error free. Anyone with ideas? Thanks
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
09/28/12 05:32 PM (13 years ago)
was able to fix this after searching net by deleting [NSString stringWithString: and the bracket after the last ". Not an objective c expert so don't know why this works if anyone would like to chime in.
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
10/04/12 04:46 AM (13 years ago)
Hi Stevek, Thnk you so much for posting your problem AS WELL AS the solution. I came across the same warning. S, does it mean that: [BT_debugger showIt:self:[NSString stringWithFormat:@"building screen from stale configuration data: @", [self saveAsFileName]]]; becomes: [BT_debugger showIt:self:@"building screen from stale configuration data: @", [self saveAsFileName]]; ? Thanks for the confirmation, I get goose bumps just thinking about amending the code manually.... Farcat
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.