我有代码
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"];
在应用程序的applicationDidFinishLaunching
方法中,每当它到达最后一行时,它就会崩溃,EXC_BAD_ACCESS
一路抛出。
提前致谢!