NSDictionary sigbart
i have some very strang behavior in iOS when using a NSMutableDictionary. I am using the following code to access a dictionary from the app delegate.
self.dictTyp = appDelegate.dictTyp;
NSLog(@"%@", dictTyp);
NSArray *keys = [dictTyp allKeys];
The output of the NSLog is fine and it shows the content of the dictionary. but in the next line when i want to get allKeys i get an failure with unrecognized se开发者_JAVA技巧lector. can anybody tell me what i am doing wrong ?
thanks, martin
Modify NSLog to print out the type, too:
NSLog(@"%@ %@", dictTyp, [dictType class]);
Check if dicType isn't a dictionary but something else. Then go back to where you created it and make sure it is actually created as a dictionary and that it is properly retained and not released too early.
精彩评论