i am coding a program for iPhone using Xcode. i defined some attributes for user interface components like uibutton, uilabel etc in property list file. i defined one attribute as real named “cornerradius”. Now, how can i get this value from plist correctly to assign CGFloat? Is property list the best way to define attributes? what are my options, any tutorials you recommend?
in plist:
key cornerradius /key
real 6.0 /real
in code:
NSDecimal cornerRadius;
cornerRadius = [[[dao libraryItemAtIndex:0] valueForKey:@"cornerradius"] decimalValue];
[layer setCornerRadius:(CGFloat)cornerRadius];
If you are looking for program wide scope you should use NSUserDefaultsController
, keep in mind that with a plist you will be only be able to store and retrieve values, like NSNumber, NSString, NSArray, NSDictionary…