How can I define common parameters in iPhone to use everywhere in different classes.
A:
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...
Michael Kessler
2010-06-07 10:50:21
A:
Write and retrieve your parameters from a .plist file:
NSString *filePath = @"Parameters.plist";
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
NSString *value = [plistDict objectForKey:@"parameterName"];
luvieere
2010-06-07 15:46:48