This is my code:
NSString * atime = [NSString stringWithFormat:@"%@",[theDataObject.minuteArray objectAtIndex:indexPath.row]];
NSLog(@"value of atime is:%@",atime);
if (atime==@"0") {
NSString * timeStr = [NSString stringWithFormat:@"%@s",[theDataObject.secondArray objectAtIndex:indexPath.row]];
cell.timeLabel.text = timeStr;
}
else {
NSString * timeStr = [NSString stringWithFormat:@"%@m%@s",[theDataObject.minuteArray objectAtIndex:indexPath.row],[theDataObject.secondArray objectAtIndex:indexPath.row]];
cell.timeLabel.text = timeStr;
}
But it never return first statement only return second statement,even is atim value is 0.
log value:
MyAudioRecorder[2484:10703] value of atime is:0
also tried to put 0 instead of @”0″,still does not work.
Compares the memory address of
atimewith the address of constant string@"0".Compares the values that are stored in the two memory locations.
From your requirement it is seen that you want to compare the value not the memory location. So go for 2nd one.