rightBarButtonItem.title string comparison
Hello,
Busy developing an iphone app, I came accross some weird thing..
Does anyone know how to compare the navigationItem.rightBarButtonItem.title with a hardcoded string.
I have the following:
option 1:
NSComparisonResult result = [self.navigationItem.rightBarButtonItem.title compare:@"show on map"];
if(result)
{
}
option 2:
NSString *title = [NSString stringWithFormat:@"%@", self.navigationItem.rightBarButtonItem.title];
if(title == @"show on map")
{
}
option 3:
if(self.navigationItem.rightBarButtonItem.title == @"show on map")
{
}
All options seems to fail in the comparison. But when I log the title:
NSLog(@"title %@", self.navigationItem.rightBarButtonItem.title);
There he shows: title show on map...
Strange?
|