objective c - Trying to remove a decimal from NSString -
this bizarre.
developing iphone have nsstring:
distancefromtargetstring = @"6178266.000000" // not code, value taken elsewhere. proper nsstring though.
when use
nsarray *listitems = [distancefromtargetstring componentsseparatedbystring:@"."]; distancefromtargetstring = [listitems objectatindex:0];
or this
[distancefromtarget settext: distancefromtargetstring];
i this
-[nsdecimalnumber isequaltostring:]: unrecognized selector sent instance 0x1cac40 2011-07-21 14:29:24.226 assassinbeta[7230:707] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsdecimalnumber isequaltostring:]: unrecognized selector sent instance 0x1cac40'
any ideas?
you try :
nsinteger = [distancefromtargetstring integervalue]; nsstring s = [nsstring stringwithformat:@"%d", i]; // got string
Comments
Post a Comment