iphone - getting plist from documents directory instead of Bundle -
I'm trying to point out the document directory instead of the bundle, I have the following code:
< Pre> - (id) initWithLibraryName: (NSString *) libraryName {if (self = [super init]) {libraryPlist = libraryName; LibraryContent = [[NSArray alloc] initWithContentsOfFile: [[NSBundle main bundle] pathForResource: LIST OF LIST OF LIBRARY: @ "plist"]];
I know that I need to use the following points in the directory of documents to the app:
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask , YES); NSString * document directory = [path item overindexx: 0];
My question is how do I insert this pointer in the above example?
[[NSBundle mainBundle] pathForResource: list of library type: @ "plist"];
is equally:
[document directory stringbapping path comparison: [List of libraries StringPaypingPath Extension: @ "Plist"]];
Except that the bundle call will return to zero if the file does not exist You can check whether a file exists by using NSFileManager in fileExistsAtPath:
.
Comments
Post a Comment