CGSize
is not an object. It's a C struct. If you need to store this in an obj-c collection the standard way is by wrapping it in NSValue
, like so:
NSArray *rows = @[
@{@"size" : [NSValue valueWithCGSize:(CGSize){self.view.bounds.size.width, 100}]
}
];
Then later when you need to get the CGSize
back, you just call the -CGSizeValue
method, e.g.
CGSize size = [rows[0][@"size"] CGSizeValue];