UIWindow对象的获取

UIWindow *window = [UIApplication sharedApplication].keyWindow;   // 获得根窗口

自定义UIActionSheet需要使用这个才能保证弹出的界面在最前面,否则会被tabBarViewController阻挡

   self.standardIBAS = [[IBActionSheet alloc] initWithTitle:@"Standard IBActionSheet"
                                                    delegate:self
                                           cancelButtonTitle:@"Cancel"
                                      destructiveButtonTitle:@"Emphasis"
                                      otherButtonTitlesArray:@[@"Other", @"Buttons"]];
    UIWindow *window = [UIApplication sharedApplication].keyWindow;

猜你喜欢

转载自lizhuang.iteye.com/blog/2079725