2

我想知道如何为用户提供从服务器下载内容的方式。

如果用户订阅一个月,我想每天为他们提供新的内容(歌曲)。但我不确定如何解决这个问题。

我是否需要application didFinishLaunchingWithOptions在 -(void)applicationDidBecomeActive:(UIApplication *)application {

对于这种情况,我应该使用哪一个?

4

1 回答 1

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.
}
于 2012-08-23T09:51:08.427 回答