Saving Transforms into NSUserDefaults?
I am making a game, and want to save the states of the game scene. I know we can save CGPoints into NSUSerDefaults, but is there any way to save "Transform" into it?
If not, is there any function to "开发者_开发知识库read" a transform (for eg, the scale/angle of a view)?
Thanks in advance for your help.
Simple, wrap it in an NSValue
:
CGAffineTransform t;
[userDefaults setObject:[NSValue valueWithCGAffineTransform:t] forKey:@"Transform"];
精彩评论