I have a dictionary which does contain an object but is returns nil.
// returns nil
(lldb) po [_contentRatings objectForKey:rating]
nil
// this is the rating string
(lldb) po rating
'=7+’
// using a literal string works
(lldb) po [_contentRatings objectForKey:@"'=7+'"]
5
It must be not liking the quotes since this fails string equality:
(lldb) po @"'=7+'"
'=7+'
(lldb) po rating
'=7+’
(lldb) p (BOOL)[@"'=7+'" isEqualToString:rating]
(BOOL) $10 = NO
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.