其视图不在NSNotification的窗口层次结构中

时间:2014-01-31 04:36:56

标签: ios ios7

我有错误 其视图不在窗口层次结构中!

当我是NSnotification时

- (void) receiveTestNotification:(NSNotification *) notification
{


    if ([[notification name] isEqualToString:@"TestNotification"])
        NSLog (@"Successfully received the test notification!");


    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    mainTabViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"passID"];
    [vc setModalPresentationStyle:UIModalPresentationFullScreen];

    [self presentViewController:vc animated:YES completion:nil];

}

1 个答案:

答案 0 :(得分:1)

如果要在单元格内显示活动视图,
也许在标题旁边,你可以使用类似的东西,

 UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc]     initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
  [cell.imageView addSubview:activityView];
  [activityView startAnimating];