【发布时间】:2014-11-20 22:35:26
【问题描述】:
我收到此错误:
没有堆栈跟踪。
-[__NSArrayI countByEnumeratingWithState:objects:count:]: message sent to deallocated instance
这个方法叫什么?
是否可以确定这是什么?我有僵尸,但没有看到来电者。
这里是线程 1:
其他唯一可点击的线路是来自 AFNetworking ([runloop run]) 的线路。我刚刚升级了我的 AFNetworking pod。
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
@autoreleasepool {
[[NSThread currentThread] setName:@"AFNetworking"];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
}
}
编辑:@autoreleasepool 上的上述断点甚至没有被命中。我确实在另一个线程中的同一崩溃的代码中找到了这个(上次没有看到这个):,在archiveSuccessful = line
- (void)archiveContent:(BOOL)changeNotification userInfo:(NSDictionary *)userInfo {
BOOL archiveSuccessful;
@synchronized(self) {
archiveSuccessful = [NSKeyedArchiver archiveRootObject:self.contentDictionary toFile:self.filePath];
}
if (archiveSuccessful) {
if(changeNotification && self.contentChangedNotificationName) {
[[NSNotificationCenter defaultCenter] postNotificationName:self.contentChangedNotificationName object:nil userInfo:userInfo];
}
} else {
NSAssert(NO, @"Saving archive to %@ was not successful", self.filePath);
}
}
这是被调用的
- (void)addObjects:(NSArray *)objects changeNotification:(BOOL)changeNotification {
[objects enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if([obj conformsToProtocol:NSProtocolFromString(@"DRLocalObject")]) {
[self addObject:obj changeNotification:NO];
}
}];
[self addObject... 行的调试器打印输出
(lldb) po obj
0x00007fde0ff56770
(lldb) po 0x00007fde0ff56770
140591727208304
编辑:
threadMain: 从 Google 分析中调用。项目查找和快速打开显示没有名为 threadMain: 的选择器
【问题讨论】:
-
对数组进行快速枚举时调用。
-
如 for (myobject *f in myArray)?我可以搜索什么代码在项目中找到它?
-
您是否添加了异常断点以查看它是否确定了违规行?
-
是的,我有所有异常断点。
-
堆栈跟踪消息的描述性足以告诉您,您正在对已释放实例调用 countByEnumeratingWithState。请检查如何解除分配?
标签: ios objective-c afnetworking google-analytics-sdk