我有一個類SpinnerController具有對活動的指標如何在多個視圖中使用一個活動指示器?
-(void)StartSpinner
{
[spinner startAnimating];
spinner.hidden=YES;
spinner = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(141.0, 190.0,
80.0, 80.0)];
[self.view addSubview:spinner];
NSLog(@"Spinner running");
}
-(void)StopSpinner
{
[spinner stopAnimating];
spinner = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(141.0, 190.0, 80.0,
80.0)];
[self.view addSubview:spinner];
}
方法我有其他8個viewControllers,我想使用上述功能使用活動的指標。
我該怎麼做?
將此函數添加到其他所有視圖c ontroller ..是不是很簡單? – AsifHabib
我想從一個類到另一個類使用這個函數。 – user3109827