dispatch_group EXC_BAD_INSTRUCTION

时间:2014-03-17 20:05:42

标签: ios objective-c grand-central-dispatch exc-bad-instruction

当我使用EXC_BAD_INSTRUCTION时,我遇到了一个奇怪的dispatch_group_t崩溃。我正在使用MagicalRecord并且在MagicalRecord保存后触发了我的成功块。如果没有保存更改,我的dispatch_group_leave(group)行会崩溃 - 否则它可以正常工作。我有几个类似的调用是该组的一部分,我遇到了所有这些相同的问题。我完全迷失了......任何想法?

以下是我的代码:

// Create a group that will wait until all the profile elements have been update before hiding the activity indicator
dispatch_group_t group = dispatch_group_create();

dispatch_group_enter(group);
[self.user readProfileWithContext:self.backgroundMOC
                          success:^{
                              dispatch_async(dispatch_get_main_queue(), ^{
                                  [self.view setPreferencesForUser:self.user];
                              });
                              // I get the crash on this line when Magical Record doesn't have any changes
                              dispatch_group_leave(group);
                          } failure:^(NSError *error) {
                              dispatch_group_leave(group);
                          }];

修改 我没有在控制台中获得任何输出,但我确实将此作为回溯中的问题(不确定这是否有用): enter image description here

0 个答案:

没有答案