#pragma mark Activity methods
- (void)openActivity
{
// 添加网络指示器
activityIV = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[activityIV setFrame:CGRectMake(0, 0, 30, 30)];
[activityIV setCenter:CGPointMake(self.view.center.x, self.view.center.y)];
[self.view addSubview:activityIV];
[activityIV setHidesWhenStopped:YES];
[activityIV setHidden:NO];
[activityIV startAnimating];
// 在状态栏显示有网络请求的提示器
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
- (void)closeActivity
{
// 关闭网络指示器
[activityIV setHidden:YES];
[activityIV stopAnimating];
// 在状态栏关闭有网络请求的提示器
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}