KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I seem to be having problems storing a CGRect into an NSDictionary . The code I'm using: dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"Crocodile", [NSValue valueWithCGRect:CGRectMake(100,100,200,200)], nil]; From what I've read, that should wrap my CGRect up into an NSValue and store it into the dictionary. However, when I tried to NSLog it, the value returns as {{0,0}, {0,0}} NSLog(@"Crocodile value is: %@", NSStringFromCGRect([[dictionary objectForKey:@"Crocodile"] CGRectValue])); I have checked my dictionary count and the items seem to be inserted. I'm not sure where this is failing. I've also tried to manually break it down by creating a CGRect var, then an NSValue var, and sticking that into the dictionary with the same results. Any help appreciated. Thanks Thank you.
Tags (comma-separated)
Save Edits
Cancel