NSInternalInconsistency Exception - findPlaylistByID无效 - 这是什么意思?

时间:2011-10-10 01:29:39

标签: ios xcode4

我在XCode 4中捕获错误而未进行任何更改。附上错误的屏幕截图,这是我怀疑引起问题的代码。如果可以,请帮帮我,我不知道为什么我会收到这个错误:

e- (void)fetchVideoInfoForPlaylist:(id)aDict {
BrightcoveDemoAppDelegate *delegate = (BrightcoveDemoAppDelegate *)[[UIApplication sharedApplication] delegate];
BCMediaAPI *bc = delegate.bcServices;
PlaylistCacheObject *playlistCacheObj;
BCPlaylist *playlist = (BCPlaylist *)[aDict objectForKey:PLAYLIST_DICT_KEY];
UITableViewCell *cell = (UITableViewCell *)[aDict objectForKey:CELL_DICT_KEY];
NSNumber *key = [NSNumber numberWithLong:playlist.playlistId];

if ([playlistCache objectForKey:key]) {
    playlistCacheObj = [playlistCache objectForKey:key];
}
else {
    // request, stash in cache
    NSError *err;
    playlist = [bc findPlaylistById:playlist.playlistId videoFields:[NSArray arrayWithObjects:@"thumbnailURL",nil] playlistFields:[NSArray arrayWithObjects:@"videos", @"thumbnailURL",nil] customFields:nil error:&err];
    if (!playlist) {
        [[ErrorHandlerService sharedInstance] logMediaAPIError:err];
    } 
    else if (playlist.videos && [playlist.videos count] > 0) {
        [playlist.videos objectAtIndex:0];

        // fetch the thumbnai for the first video
        NSString *imageURL = [playlist thumbnailURL];
        UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]]; 
        playlistCacheObj = [[[PlaylistCacheObject alloc] initWithData:playlist image:image] autorelease];
    [playlistCache setObject:playlistCacheObj forKey:key];  ;   }   

    }       

CRASH LOG SCREENCAP

1 个答案:

答案 0 :(得分:0)

断言是从BCPlaylistReadService而不是PlaylistTableViewController引发的。我怀疑那里有一个NSAssert。我猜这个playlistplaylist.playlistIdnil,但是playlist.playlistId可能只是无效,因为断言会注意到。