Hi,
I've spent hours looking for an answer to what I know is a newbee question but to no avail. I know the solution has to be straightforward but....
I want to use the title from a button to perform a task. What I have is the following:
-(IBAction)doSomethingWithButton: (id)sender {
NSString *whatToDo = [(UIButton *)sender currentTitle];
if (whatToDo == @"+")
{//do some action
}
[whatToDo release];
}
The problem is that the logical operator doesn't work. It seems that whatToDo is type NSString and is incompatible with @"+".
Any help appreciated!
thanks
I've spent hours looking for an answer to what I know is a newbee question but to no avail. I know the solution has to be straightforward but....
I want to use the title from a button to perform a task. What I have is the following:
-(IBAction)doSomethingWithButton: (id)sender {
NSString *whatToDo = [(UIButton *)sender currentTitle];
if (whatToDo == @"+")
{//do some action
}
[whatToDo release];
}
The problem is that the logical operator doesn't work. It seems that whatToDo is type NSString and is incompatible with @"+".
Any help appreciated!
thanks