// create CGRect
CGRect rect = CGRectMake(0, 20, 7.5f, 7.5f);
// create Array
NSMutableArray *foo = [[NSMutableArray alloc] init];
// add the rect
[foo addObject:[NSValue valueWithRect:rect]];
// get the rect
CGRect theRect = [[foo objectAtIndex:0] CGRectValue];
// increase y offset
theRect.origin.y += 20;
CGRect theRectAgain = [foo objectAtIndex:0];
theRectAgain.origin.y is still 20!
Clearly I lack some knowledge here, what is going on, why is theRectAgain.origin.y still 20?
CGRect rect = CGRectMake(0, 20, 7.5f, 7.5f);
// create Array
NSMutableArray *foo = [[NSMutableArray alloc] init];
// add the rect
[foo addObject:[NSValue valueWithRect:rect]];
// get the rect
CGRect theRect = [[foo objectAtIndex:0] CGRectValue];
// increase y offset
theRect.origin.y += 20;
CGRect theRectAgain = [foo objectAtIndex:0];
theRectAgain.origin.y is still 20!
Clearly I lack some knowledge here, what is going on, why is theRectAgain.origin.y still 20?