Okey, I have two strings containing numbers like shown here using debugger:
String 1
(gdb) po [event creator_id]
123456789
(gdb) p [event creator_id]
$1 = (NSString *) 0xad81d10
String 2
(gdb) po [delegate userid]
123456789
(gdb) p [delegate userid]
$2 = (NSString *) 0x7451b40
Now I want to check if they are equal to each other and therein lies the problem.
The if-statement below will for some reason not return true:
if ([[delegate userid] isEqualToString: [event creator_id]]) {
NSLog(@"They are equal!");
}
Can someone please explain to me how this can happen? Thank you for your time!
It could be because either of below is FALSE
po is “print-object” it prints the description (which is string) of object. The description property is available at NSObject level.
Hope it helps you.