I got a function which should return an intvalue.
- (int)function:(NSString *)input
{
if (input == @"test1")
{
return 0;
}
if (input == @"test2")
{
return 1;
}
if (input == @"test3")
{
return 2;
}
else
{
return 3;
}
}
Here I call the function:
[self function:self.detailItem.type]
The debugger shows input __NSCFString * 0x6b9a0b0 and returns any 29938idontknowvalue.
If I call [self function:@"test1"] everything works fine.
The detailItemis type of TVwhich is a NSManagedObjectwith the attribute type defined as string. Should be a problem with the string-types?
Thank you!
You should compare NSString like this :