2013-07-24 87 views

回答

4

您可以試試這個 -

[SPAsyncLoading waitUntilLoaded:[SPSession sharedSession] timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedession, NSArray *notLoadedSession) 
{ 
    // The session is logged in and loaded — now wait for the userPlaylists to load. 

    [SPAsyncLoading waitUntilLoaded:[SPSession sharedSession].userPlaylists timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedContainers, NSArray *notLoadedContainers) 
    { 
     // User playlists are loaded — wait for playlists to load their metadata. 

     NSMutableArray *playlists = [NSMutableArray array]; 
     [playlists addObject:[SPSession sharedSession].starredPlaylist]; 
     [playlists addObject:[SPSession sharedSession].inboxPlaylist]; 
     [playlists addObjectsFromArray:[SPSession sharedSession].userPlaylists.flattenedPlaylists]; 

     [SPAsyncLoading waitUntilLoaded:playlists timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedPlaylists, NSArray *notLoadedPlaylists) 
     { 
      // All of our playlists have loaded their metadata — wait for all tracks to load their metadata. 
      arrPlaylist = [[NSMutableArray alloc] initWithArray:loadedPlaylists]; 
      NSLog(@"arrPlaylist %@",arrPlaylist); 
     }]; 
    }]; 
}]; 
相關問題