I am trying to save an array containing values CGRect. I know that plists are not compatible with the type CGRect, so I changed my code a bit, and now I save NSNumberinstead of saving the rect value - I divide the rectangle 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 it myArray1contains only NSNumber, and I am trying to store these values in a plist, but I can not load the values back. Can someone fix me if I have something wrong with my code?
Thanks in advance; I look forward to your valuable information.
source
share