NSNotification在iPhone模拟器中失败,而不是在iPad设备中,而不是在iPad模拟器中

时间:2014-02-17 14:07:28

标签: ios iphone objective-c

我有一个像这样调用的事件:

[[NSNotificationCenter defaultCenter] postNotificationName:VIDEO_REQUESTED object:nil userInfo:dictionary];

当我在iPad设备或ipad模拟器上运行代码时,会调用事件方法。

然而,在iphone模拟器中,方法永远不会被调用,它会无声地失败。

调用的方法是这样的:

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

    NSDictionary *dictionary = [notification userInfo];
    NSString *stringValueToUse = [dictionary valueForKey:@"imgID"];



    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){

        [self dismissViewControllerAnimated:YES completion:nil];

    } else {

        //
        [self.popoverController dismissPopoverAnimated:YES];

    }


    [AdColony playVideoAdForZone:@"-" withDelegate:self withV4VCPrePopup:YES andV4VCPostPopup:YES];

}

0 个答案:

没有答案