I am trying to save an array which contains CGRect
values. I know plists are not compatible with the CGRect
type, so I slightly modified my code and now I am storing NSNumber
instead of storing the rect value -- I split the rect value into four values: x, y, width, height.
[myArray1 addObject:[NSNumber numberWithFloat:CGRectGetMinX(rawRect)]];
[myArray1 addObject:[NSNumber numberWithFloat:CGRectGetMinY(rawRect)]];
[myArray1 addObject:[NSNumber numberWithFloat:CGRectGetWidth(rawRect)]];
[myArray1 addObject:[NSNumber numberWithFloat:CGRectGetHeight(rawRect)]];
Now myArray1
contains only NSNumber
s and I am trying to store these values into a plist, but I can't loading the values back. Can any one correct me if I am doing anything wrong with my code?
Thanks in advance; I'm waiting for your valuable information.