I have a TableViewCell where there is a button Zoom Button. When I click to the Zoom button the view will be navigation to PlayerViewController.
(https://www.dropbox.com/s/ikmj4vdfc407ldy/customcell.png)
Here is my Code for the play Button.
-(IBAction)downloadAction:(id)sender
{
BookPlayerViewController *bookPlayerViewController=[BookPlayerViewController alloc];
[self.navigationController pushViewController:bookPlayerViewController animated:YES];
}
How can I solve this problem?. I am implementing the project using Nib instead of storyboard.
I created an outlet property in the tableviewcell class
@property (retain, nonatomic) IBOutlet UIButton *zoomButton;
Then I add the target in the superclass in tableviewCellForRowAtIndex method
[cell.zoomButton addTarget:self action:@selector(navigateAction:) forControlEvents:UIControlEventTouchUpInside];
Then I take IBAction of navigateAction I wrote those actions required to navigate from one ViewController to Another ViewController.
-(IBAction)navigateAction:(id)sender
{
*UIButton *btn = (UIButton *)sender;
int indexrow = btn.tag;
NSLog(@"Selected row is: %d",indexrow);
currentBook = [[bookListParser bookListArray] objectAtIndex:indexrow];
KitapDetayViewController *kitapDetayViewController;
if(IS_IPHONE_5)
{
kitapDetayViewController = [[KitapDetayViewController alloc] initWithNibName:@"KitapDetayViewController" bundle:Nil];
}
else
{
kitapDetayViewController = [[KitapDetayViewController alloc] initWithNibName:@"KitapDetayViewController_iPhone4" bundle:Nil];
}
kitapDetayViewController.bookId=currentBook.bookId;
kitapDetayViewController.detailImageUrl = currentBook.detailImageUrl;
kitapDetayViewController.bookAuthor = currentBook.bookAuthor;
kitapDetayViewController.bookName = currentBook.bookName;
kitapDetayViewController.bookDescription = currentBook.bookDescription;
kitapDetayViewController.bookNarrator=currentBook.bookNarrator;
kitapDetayViewController.bookOrderHistory=currentBook.bookOrderDate;
int byte=[currentBook.bookSizeAtByte intValue];
int mb=byte/(1024*1024);
NSString *mbString = [NSString stringWithFormat:@"%d", mb];
kitapDetayViewController.bookSize=mbString;
kitapDetayViewController.bookOrderPrice=currentBook.priceAsText;
int second=[currentBook.bookDuration intValue];
int minute=(second/60)%60;
int hour=(second/3600)%60;
int sec = second % 60;
NSString *formattedTime = [NSString stringWithFormat:@"%d:%d:%d", hour, minute, sec];
kitapDetayViewController.bookDuration=formattedTime;
kitapDetayViewController.chapterNameListArray=self.chapterNameListArray;
// [[bookListParser bookListArray ]release];
[self.navigationController pushViewController:kitapDetayViewController animated:YES];*
}
This way I have solved the problem.