需要弹出哪个View ,就在哪个View中写个方法,在.h中也定义下方法,需要的时候直接调用方法
-(void)show{ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate ; UIView *rootView = appDelegate.window.rootViewController.view ; if ([rootView viewWithTag:kTag]) { return ; } [rootView addSubview:self]; self.tag = 123456; }