在FeaturedViewController.m
- (void)viewDidLoad
{
//create reference of your delegate
YourAppDelegate rootApp = (YourAppDelegate *)[[UIApplication sharedApplication]delegate];
double playlistId = [[[[rootApp playlists] items] objectAtIndex:indexPath.row] playlistId ];
[super viewDidLoad];
}
EDITED
或者你可以在FeaturedViewController定義屬性,並在此VC像賦值:
FeaturedViewController nextView = [[FeaturedViewController alloc] initWithNibName:@"FeaturedViewController" bundle:nil];
//below lineset the value of property and you can pass value to nextView
nextView.playlistId = [[playlists.items objectAtIndex:indexPath.row] playlistId]; ;
[self.navigationController pushViewController:nextView animated:YES];
希望它讓你想法訪問變量的代表
你有沒有在委託文件中聲明你的播放列表變量? – Maulik
是的,我已經綜合了它和一切;但是甚至不會把ID放回NSLog。 – MaikelS
給一些更多的代碼。你如何試圖獲得一個ID? – Maulik