获取 window

(1)

UIApplication * app = [UIApplication  sharedApplication];

ZYAppDelegate * appDelegate = app.delegate ;

UIWindow * window = appDelegate.window ;

(2)

UIWindow *window = [UIApplication sharedApplication].keyWindow;

你可能感兴趣的:(ios,window,ios开发)