My code is reading a list of key/value pairs like follows:
A:nodeAbc
...
Q:node2
R:
T:node3
...
Each pair is split using NSString:componentsSeparatedByString:
NSArray *kv = [@"R:" componentsSeparatedByString:@":"];
In the list example above, R has no matching value. As I ask to print it, here is what I get:
(lldb) po [kv objectAtIndex:1]
(id) $33 = 0x00007fff77a888e0
How can I identify this?
if ([kv objectAtIndex:1]) // returns YES
I’d like it to be treated as a nil, how can it be done?
Thanks!
It’s not nil, it’s an empty string (read the docs, it’s stated there). What you want is