gpt4 book ai didi

ios - NSSearchPathForDirectoriesInDomains 崩溃

转载 作者:行者123 更新时间:2023-12-02 01:19:43 25 4
gpt4 key购买 nike

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”处崩溃?我不熟悉崩溃报告,感谢您的帮助。

最佳答案

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

关于ios - NSSearchPathForDirectoriesInDomains 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17140757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com