iOS: encoding a custom view with a shape in it
iOS: encoding a custom view with a shape in it
- Subject: iOS: encoding a custom view with a shape in it
- From: Development <email@hidden>
- Date: Thu, 09 Jun 2011 16:25:10 -0700
This app allows users to do a number of graphical things. On of those things is to draw rectangles and ellipses.
No it would not be complete if they could not resize and rotate these shapes. Thus the features exist.
The problem comes when I freeze dry the object.
I encode it exactly as it exists at the moment the saveDocument: option is invoked.
colors, frame,rotation etc
logging these values confirms them
When I unfreeze it, well the values remain identical. hence I know the save worked.
I initialize the object with the decoded rectangle for the frame
I then apply the transition to rotate it to the correct angle.
hmm the result looks nothing like the initial item did at save time
So I've been looking at this very closely... Is this happening because simply applying the last known frame and angle does not mean it will match?
If this is the case, does it mean then that in order to preserve the exact state, I must not only save all the data about the object but an array of every change made to the object such as resizes and rotations in order to get the correct result?
My bandaid is to convert the view in to a UIImage and save the image. This "fixes" the problem however the downside is that special effects that can be applied to rectangles and ellipses are not available on reload. _______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden