After parsing and get values for each elements from XML, one of the field is null like below
Below is my xml structure
I am doing a checking :
After running the codes, the debugger gives me
It seems isEqualToString is not working.I also try !(myXML.phone == NULL) and !([myXML.phone isEqual:NULL]), but still get same problem
Does anyone have an idea about this.. pls advice me. Thanks
Code:
myXML.h
@property (strong, nonatomic) NSString *address;
@property (strong, nonatomic) NSString *phone;
Below is my xml structure
Code:
<myXML>
<address> A Street </address>
<phone> (null) </phone>
</myXML>
I am doing a checking :
Code:
if ( ![myMXL.phone isEqualToString:@"null"] ) {
NSLog(@"phone is not null");
else
NSLog(@"phone is null");
After running the codes, the debugger gives me
Code:
phone is not null
It seems isEqualToString is not working.I also try !(myXML.phone == NULL) and !([myXML.phone isEqual:NULL]), but still get same problem
Does anyone have an idea about this.. pls advice me. Thanks