2012-08-23 83 views
2

我想知道如何提供用戶從服務器下載內容的方式。應用程序didFinishLaunchingWithOptions`或applicationDidBecomeActive

我的意思是如果用戶訂閱了一個月,我想每天發送一個新內容(歌曲)。但我不確定如何處理這個問題。

我是否需要調用web服務的application didFinishLaunchingWithOptions或 - (void)applicationDidBecomeActive:(UIApplication *)application {

請讓我知道我應該使用哪一個對於這種情況。

非常感謝您的幫助

回答

1

如果你在開始一個新的連接計劃時,應用程序啓動,那麼你要使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    // Override point for customization after application launch. 
    return YES; 
} 

然而,applicationDidBecomeActive更適合當您的應用程序停止後臺時,恢復您暫停的下載。在這裏開始下載也可以接受。

- (void)applicationDidBecomeActive:(UIApplication *)application 
{ 
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 
} 
相關問題