Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 查找视图控制器未使用仪表调用dealloc的RefCt问题_Iphone_Ios_Xcode_Instruments - Fatal编程技术网

Iphone 查找视图控制器未使用仪表调用dealloc的RefCt问题

Iphone 查找视图控制器未使用仪表调用dealloc的RefCt问题,iphone,ios,xcode,instruments,Iphone,Ios,Xcode,Instruments,我试图使用仪器来发现为什么我的视图控制器从导航控制器弹出时不调用dealloc。在查看分配时,我发现当我弹出视图控制器时,它的RefCt为2。我试图浏览所有的retainrelease消息,但确实发现了一组似乎不正常的分配。其中有30条消息,16条保留消息和14条发布消息。这是我的问题吗?这些电话到底在干什么?我假设我在某处的街区里保持着自我 Retain __copy_helper_block_335 Retain __copy_helper_block_361 Retain __cop

我试图使用仪器来发现为什么我的视图控制器从导航控制器弹出时不调用dealloc。在查看分配时,我发现当我弹出视图控制器时,它的RefCt为2。我试图浏览所有的retainrelease消息,但确实发现了一组似乎不正常的分配。其中有30条消息,16条保留消息和14条发布消息。这是我的问题吗?这些电话到底在干什么?我假设我在某处的街区里保持着自我

Retain  __copy_helper_block_335
Retain  __copy_helper_block_361
Retain  __copy_helper_block_391
Retain  __copy_helper_block_387
Retain  __copy_helper_block_91
Retain  __copy_helper_block_84
Retain  __copy_helper_block_1797
Retain  __copy_helper_block_2139
Retain  __copy_helper_block_2143
Retain  __copy_helper_block_1647
Retain  __copy_helper_block_2139
Retain  __copy_helper_block_2143
Retain  __copy_helper_block_1678
Retain  __copy_helper_block_2139
Retain  __copy_helper_block_2143
Retain  __copy_helper_block_57
Release __destroy_helper_block_392
Release __destroy_helper_block_336
Release __destroy_helper_block_388
Release __destroy_helper_block_92
Release __destroy_helper_block_85
Release __destroy_helper_block_2140
Release __destroy_helper_block_2144
Release __destroy_helper_block_1648
Release __destroy_helper_block_2140
Release __destroy_helper_block_2144
Release __destroy_helper_block_1679
Release __destroy_helper_block_2140
Release __destroy_helper_block_2144
Release __destroy_helper_block_58
我已经阅读了许多关于视图控制器未调用dealloc的其他问题,但仍无法将我的RefCt设置为0。确保我所有的代表都很虚弱,并在所有的街区中用力敲打,以确保我不会在街区中保持自我。但是,在某些地方,我使用self而不是uu-weak([GKMatchmaker sharedMatchmaker].inviteHandler=^(例如,gkivent*acceptedInvite,NSArray*playersToInvite)。我需要在这里使用weakSelf吗

- (void) setupInvitationHandler {
    [GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) {

        ( ... )

        GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithInvite:acceptedInvite];
        mmvc.matchmakerDelegate = [self.navigationController.viewControllers objectAtIndex:0];
        [self presentViewController:mmvc animated:YES completion:^{
            [self.navigationController popToRootViewControllerAnimated:NO];
        }];
    }];
}

所以,我在模拟器上运行这个测试。在我的设备上运行时,我没有不匹配的保留/释放问题。那我就不用担心了吧?