获取window上的view

导入头文件
#import "AppDelegate.h"


UIView *view = [UIApplication sharedApplication].delegate).window.rootViewController.view;

编程技巧