Im working with a table view, and im wondering why my if-statement is false.
Probably a really simple error. I have debugged and I saw that ‘message’ contained the value of the tableview cell.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *message = [NSString stringWithFormat:@"%@",[tableViewArray objectAtIndex:indexPath.row]];
NSString *apple = [NSString stringWithFormat:@"Apple"];
if(apple == message)
.....
Thanks for help!
You are comparing objects. You’ll want to use the following code instead: