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" :
Then I extracted the numerical value of the string "piste" into an int called pisteInt:
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 :
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 ?
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 ?