开发者

common parameters in iphone

开发者 https://www.devze.com 2023-01-02 07:29 出处:网络
How can I define common parameters in iPhone to use everywhere in different c开发者_运维百科lasses.Write and retrieve your parameters from a .plist file:

How can I define common parameters in iPhone to use everywhere in different c开发者_运维百科lasses.


Write and retrieve your parameters from a .plist file:

NSString *filePath = @"Parameters.plist";
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];

NSString *value = [plistDict objectForKey:@"parameterName"];


You can also add common definitions class file (e.g. AppConstansts.h), fill it with defines (e.g. #define CELL_HEIGHT 44.0) and add an import line (#import "AppConstansts.h") in <Your project name>_Prefix.pch file that is usually located under "Other Sources" group in the project.

After doing it CELL_HEIGHT will be accessible from all your source files...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号