I have been trying to do this for a long time now. so here is what I am doing
firstviewcontroller
.h
iPhoneStreamingPlayerViewcontroller *viewController;
@property(nonatomic,retain)iPhoneStreamingPlayerViewController *viewController;
.m
in didselectrowatindexpath
BooksNavController *bks = [[BooksNavController alloc]init];
bookDetailViewController.title = [NSString stringWithFormat:@"%@",[booksArray objectAtIndex:rowSelected]];
NSString *ti = [NSString stringWithFormat:@"%@",[booksArray objectAtIndex:rowSelected]];
[bookDetailViewController title3:ti];
Music_appAppDelegate *delegate = [[UIApplication sharedApplication]delegate];
[delegate.booksNavController pushViewController:bookDetailViewController animated:YES];
[bks nowPlayingView:bookDetailViewController];
NSString *check = [NSString stringWithFormat:@"%@",[urlArray objectAtIndex:rowSelected]];
[bookDetailViewController check:check];
[bks release];
now in secondviewcontroller
in didselectrowatindexpath (is a tableview again)
if (self.bookDetailViewController == nil)
{
iPhoneStreamingPlayerViewController *aBookDetail = [[iPhoneStreamingPlayerViewController alloc] initWithNibName:@"iPhoneStreamingPlayerView" bundle:nil];
self.bookDetailViewController = aBookDetail;
[aBookDetail release];
}
BooksNavController *bks = [[BooksNavController alloc]init];
bookDetailViewController.title = [NSString stringWithFormat:@"%@",[booksArray objectAtIndex:rowSelected]];
NSString *ti = [NSString stringWithFormat:@"%@",[booksArray objectAtIndex:rowSelected]];
[bookDetailViewController title3:ti];
Music_appAppDelegate *delegate = [[UIApplication sharedApplication]delegate];
[delegate.booksNavController pushViewController:bookDetailViewController animated:YES];
[bks nowPlayingView:bookDetailViewController];
NSString *check = [NSString stringWithFormat:@"%@",[urlArray objectAtIndex:rowSelected]];
[bookDetailViewController check:check];
[bks release];
PlaylistTableViewController *playlistTableViewController = [[PlaylistTableViewController alloc]init];
[playlistTableViewController checkView:2];
playlistTableViewController.bookDetailViewController1 = bookDetailViewController;
[playlistTableViewController release];
This isn't working though the view is being set to nil for some reason I don't know why (I have made a property for the view too).