我有一个应用程序,如果本地数据库中有数据,那么它会在启动应用程序之前先将其上传到服务器我已经在应用程序 Deleage 中编写了上传代码我希望在上传时如何显示带有警报的活动指示器。通常很容易显示 startAnimating 和 Stop ,但是在这种情况下怎么办?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self copyDatabaseIfNeeded];
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
self.coffeeArray = tempArray;
[tempArray release];
[Coffee checkData:[self getDBPath]];
int mytestcount=rowCount;
NSLog(@"My Test ROw Count IS %d",mytestcount);
if (mytestcount=0) {
NSLog("No Data To Upload");
}
else {
[Coffee getInitialDataToDisplay:[self getDBPath]];
[self uploadData];
}
[self.window addSubview:[navigationController view]];
[self.window makeKeyAndVisible];
return YES;
}