[Code Note] iOS-display the wait dialog box in the navigation bar, ios-navigation bar
I ,.
Ii. Code.
ViewController. m
# Import "ViewController. h "@ interface ViewController () @ end @ implementation ViewController-(void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // The wait dialog box [self showActivityIndicatorViewInNavigationItem] appears in the navigation bar;} // click anywhere to stop the wait indicator-(void) touchesBegan :( NSSet *) touches withEvent :( ui* event *) event {// stop Wait indicator, restore the navigation bar self. navigationItem. titleView = nil; self. navigationItem. prompt = nil ;}# pragma-mark-functions // The wait dialog box is displayed in the navigation bar-(void) Wait {UIActivityIndicatorView * aiview = [[UIActivityIndicatorView alloc] Wait: Success]; self. navigationItem. titleView = aiview; [aiview startAnimating]; self. navigationItem. prompt = @ "loading data... ";}- (void) didReceiveMemoryWarning {[super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated .} @ end