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

RutgerB

macrumors member
Original poster
Jul 13, 2008
32
1
Hi


I have a label called currentInput. I want to get the value of the label and check whether it is equal to e.g. "hello".

I hope I've provided enough information.. I'm new to iPhone developement (I do have a lot of experience with Java and C)


Thanks

Rutger Bevers
 

Jeremy1026

macrumors 68020
Nov 3, 2007
2,215
1,029
Code:
if ([currentInput.text isEqualToString:@"Hello"]) {
     NSLog(@"Match");
}
else {
     NSLog(@"No Match");
}
 

RutgerB

macrumors member
Original poster
Jul 13, 2008
32
1
This gives an error:

Request for member 'text' in something not a structure or an union.

I assume the code is right, but something else is wrong with my application.
Any idea?

Fixed it
In the header file:
IBOutlet id currentInput; had to be IBOutlet UITextField *currentInput;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.