Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

deamb

macrumors newbie
Original poster
Jul 5, 2008
9
0
Barcelona
Hello all,

I am quite a newbie in all this programming stuff...
I got into it due to the pending 2.0 iPhone software, and I am trying to write an app for the iPhone, using the SDK and Obj-C...

Here is my problem :

The object of my app is to decode an 8 character code that can contain either numbers or "/"...

The first 2 characters should be numbers, and will decode into a runway identification

I have extracted the 8 characters from the UITextField receiving it into a string called "string";

then i "dispatched" the first 2 digit into a new string called "piste" :

Code:
piste = [string substringWithRange:NSMakeRange(0,2)];

Then I extracted the numerical value of the string "piste" into an int called pisteInt:
Code:
NSScanner *scanner;
scanner = [NSScanner scannerWithString:piste];
[scanner scanInt: &pisteInt]; // ATTENTION, returns O if no int found...!

I am now sending the decoded text into a UILabel called "labelPiste" , but I have to input that numerical value into the label, so I'm trying :

Code:
if (pisteInt <= 36)
{NSString *piste01a36 = [NSString stringwWithFormat:@"Piste %i(L)", pisteInt];
labelPiste.text = piste01a36;
}

But I get the warning : 'NSString may not respond to '+stringWithFormat'
(Messages without a matching method will be assumed to return 'id' and accept '...' as arguments.)

Can anyone help ?
 

deamb

macrumors newbie
Original poster
Jul 5, 2008
9
0
Barcelona
You've GOT to be kidding me ! !

Sorry, and thanks !

(how the hell do you pick this up so fast !!?)

thanks !
 

rand0m3r

macrumors regular
Jun 30, 2006
115
1
code completion is a useful feature of the IDE. press ESC next time u think u might spell something incorrectly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.