I have the code
NSArray *paths = [[NSArray alloc]
initWithArray:NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)];
NSString *docsDirectory = [[NSString alloc] initWithString:[paths objectAtIndex:0]];
NSLog(@"This app's documents directory: %@",docsDirectory);
NSString *docsDirectoryWithPlist = [[NSString alloc] initWithFormat:@"%@/Stuff.plist", docsDirectory];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:docsDirectoryWithPlist isDirectory:NO];
if (fileExists)
{
chdir([docsDirectory UTF8String]);
NSMutableDictionary *readDict = [[NSMutableDictionary alloc] initWithContentsOfFile:@"Stuff.plist"];
in an application's applicationDidFinishLaunching
method and whenever it gets to the last line it crashes, throwing EXC_BAD_ACCESS
along the way.
Thanks in advance!