下面是一個代碼:中斷線程1:EXC_BAD_ACCESS
for (int i = 0; i < _sevenForDisplay.length; i++) {
_sevensForReplace = [_sevensForReplace stringByReplacingCharactersInRange:NSMakeRange([[_sevenForDisplay substringWithRange:NSMakeRange(i,1)] intValue]-1,1) withString:@"1"];
NSOperation *operation = [[NSInvocationOperation alloc]
initWithTarget:self
selector:@selector(blinkPicSeven:)
object:@(_forBlink)];
[queue addOperation:operation];
}
[userDefaults setObject:_sevensForReplace forKey:@"sevens"];
當代碼在程序上與該消息的最後一行一個錯誤的工作過程中進行的 - 線程1:EXC_BAD_ACCESS(代碼= 1,地址= 0x7a0090018)。
我開始逐步調試(我成爲一個週期的開始,並進一步在F6),一切正常通過。
在舊的OSX和Xcode版本中,一切正常,在新版本中不起作用。 (該項目一年的地板)