0

私はiPadアプリを開発していますが、ポップオーバービューをうまく利用するのは初めてです。ポップオーバービューをカテゴリ付きのメニューとして使用しており、ビデオ付きの画面は1つだけです。ユーザーがカテゴリを選択すると、「FeaturedViewController」は新しいplaylistIdでビューをリロードする必要があります。

ユーザーがカテゴリを選択すると、次のように簡単に実行できます。 double playlistId = [[playlists.items objectAtIndex:indexPath.row] playlistId];

しかし、FeaturedViewControllerでそのplaylistIdを取得して、ビューをリロードするにはどうすればよいですか?

4

2 に答える 2

0

あなたの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];
}

編集済み

または、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];

デリゲートの変数にアクセスするためのアイデアが得られることを願っています

于 2011-07-29T13:18:24.887 に答える
0

見て:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// load new playlist
BCPlaylist *playlist = (BCPlaylist *) [playlists.items objectAtIndex:indexPath.row];
NSNumber *key = [NSNumber numberWithDouble:playlist.playlistId];
NSLog(@"Key: %@", key);
FeaturedViewController *nextView = [[FeaturedViewController alloc] initWithNibName:nil bundle:nil];
nextView.PLID = key;
[self.navigationController pushViewController:nextView animated:YES];
[nextView release];
}

キーNSlogは正しく記録されますが、FeaturedViewControllerのnextView.PLIDからの応答がまったく得られません。

于 2011-08-02T10:39:10.923 に答える