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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -