0
我遇到頻繁崩潰,我認爲這與檢查MIDINetwork會話數量的這種方法有關。MIDINetworkConnection導致崩潰錯誤
- (NSString*) describeConnections {
NSMutableArray* connections = [NSMutableArray arrayWithCapacity:1000];
for (MIDINetworkConnection* connection in [[MIDINetworkSession defaultSession] connections]) {
[connections addObject:[[connection host] name]];
}
if ([connections count] > 0) {
return [connections componentsJoinedByString:@", "];
}
else
return @"(Not connected)";
}
當應用程序崩潰,停止上線
for (MIDINetworkConnection* connection in [[MIDINetworkSession defaultSession] connections])
我得到的錯誤是
Thread 1: EXC_BAD_ACCESS(code=EXC_1386_GPFLT)
在調試它顯示
_impl _MIDINetworkConnectionImpl * NULL
我有試圖通過檢查M來防止崩潰在通過連接循環之前,IDINetworkSession爲NULL,但沒有奏效。有時當xcode崩潰時,它會停止在
int main(int argc, char *argv[])
{
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, nil);
return retVal;
}
}
任何人都可以提供猜測發生了什麼?
即使在檢查連接不爲空時,我仍然遇到應用程序崩潰。 – Youngin 2014-10-31 21:10:46