0

我有一个应用程序,用户报告它在随机时间崩溃。所有崩溃都有相同的堆栈

0   CoreFoundation  TAGPBIvarClearUInt32 (in SPONTAN) + 11  
1   libobjc.A.dylib _mh_execute_header (in SPONTAN) + 15567 
2   CoreFoundation  TAGPBIvarClearSFixed64 (in SPONTAN) + 13    
3   Foundation  -[AdvancedPriceViewController newAP:] (in SPONTAN) (AdvancedPriceViewController.m:68) + 110325  
4   SPONTAN +[TrStart isJSONTrStart:] (in SPONTAN) + 77 
5   SPONTAN __65-[MintRequestWorker processPreviousLoggedRequestsAsyncWithBlock:]_block_invoke_2 (in SPONTAN) + 397 
6   SPONTAN __58-[FileRepository readLoggedExceptionsWithCompletionBlock:]_block_invoke (in SPONTAN) + 281  
7   libdispatch.dylib   _mh_execute_header (in SPONTAN) + 6195  
8   libdispatch.dylib   -[FirstViewController viewDidLoad] (in SPONTAN) (FirstViewController.m:56) + 84257  
9   libdispatch.dylib   -[FirstViewController viewDidAppear:] (in SPONTAN) (FirstViewController.m:80) + 84769   
10  libsystem_pthread.dylib _mh_execute_header (in SPONTAN) + 3027  
11  libsystem_pthread.dylib _mh_execute_header (in SPONTAN) + 2712

这可能看起来不错,但是当我查看级别 3、8 和 9 时,代码不再有意义。

3   Foundation  -[AdvancedPriceViewController newAP:] (in SPONTAN) (AdvancedPriceViewController.m:68) + 110325  
Line 68: NSMutableArray *arrayOfIndexPaths = [[NSMutableArray alloc] init];

8   libdispatch.dylib   -[FirstViewController viewDidLoad] (in SPONTAN) (FirstViewController.m:56) + 84257  
Line 56: [[SelectCity titleLabel] setFont:[UIFont fontWithName:@"Avenir" size:15]];

9   libdispatch.dylib   -[FirstViewController viewDidAppear:] (in SPONTAN) (FirstViewController.m:80) + 84769   
Line 80: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

错误是 NSRangeException

*** -[__NSCFConstantString substringToIndex:]: Index 2147483647 out of bounds; string length 0

谁能告诉我这里发生了什么?

4

1 回答 1

0

在您的来源中搜索选择器的用法substringToIndex:。我对这AdvancedPriceViewController门课不熟悉;如果它是你的,你可能会substringToIndex:[AdvancedPriceViewController newAP:]NSRange-1. 当-1转换为 auint32时,它将显示为2147483647or MAX_INT

于 2014-10-20T12:50:08.083 回答