You can store CGRect
items into an NSArray
. You need to store them as NSValue
types:
NSMutableArray framesArray = [[NSMutableArray alloc] init]; CGRect frame = CGRectMake(5, 5, 80, 80); [framesArray addObject:[NSValue valueWithCGRect:frame]];
Here’s how to retrieve the items later on:
CGRect frame = [((NSValue *)[framesArray objectAtIndex:0]) CGRectValue];