NSSearchPathForDirectoriesInDomains崩溃

时间:2013-06-17 05:08:47

标签: ios crash

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x2fc30fec
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   CoreFoundation                  0x3367b788 constructBuffers
1   CoreFoundation                  0x3367af38 _parseComponents
2   CoreFoundation                  0x3367aeb2 _CFURLInit
3   CoreFoundation                  0x3367a64e CFURLCreateFromFileSystemRepresentation
4   CoreFoundation                  0x3367a41c _CFCopyHomeDirURLForUser
5   CoreFoundation                  0x3367a3ba CFCopyHomeDirectoryURLForUser
6   Foundation                      0x33f90564 NSHomeDirectoryForUser
7   Foundation                      0x33f906d6 _NSExpandTildeInPath
8   Foundation                      0x33fb16b0 -[NSString(NSPathUtilities) stringByExpandingTildeInPath]
9   Foundation                      0x33fb14c2 NSSearchPathForDirectoriesInDomains
10  WenHua                          0x0018844a +[FilePathsManager ServerAddressFileInDocument] (FilePathsManager.m:90)
11  WenHua                          0x00176bcc +[ServerAddress loadServerAdressList:dealArray:] (SeverAdress.m:102)
12  WenHua                          0x0012ebcc -[Adapter randomTradeServer] (Adapter.m:7975)

这是代码:

 +(NSString *)ServerAddressFileInDocument
    {
        NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
        return [docPath stringByAppendingPathComponent:@"ServerAddress.plist"];
    }

+ (void)loadServerAdressList:(NSMutableArray *)marketArray dealArray:(NSMutableArray *)dealArray 
{ 
      NSData *data = [NSData dataWithContentsOfFile:[FilePathsManager        ServerAddressFileInDocument]]; 
      NSKeyedUnarchiver *unArchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
      [marketArray setArray:[unArchiver decodeObjectForKey:@"market"]]; 
      [dealArray setArray:[unArchiver decodeObjectForKey:@"deal"]]; 
      [unArchiver finishDecoding]; [unArchiver release];
 } 

在此崩溃报告中,是否意味着"NSSearchPathForDirectoriesInDomains"处的应用崩溃? 我不熟悉崩溃报告,感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

在(FilePathsManager.m:90)运行“[FilePathsManager ServerAddressFileInDocument]”时,您的应用似乎崩溃了