網頁

2012年4月11日 星期三

iOS5 push next page

.m  記得引入要推頁的.h檔 #import "Information.h" #import "AboutUs.h" //要推頁
  
#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    switch (indexPath.section) {
  case 0:
   [self loadAboutUs];
   break;
  case 1:
   [self openAppURL];
   break;
 }
}

- (void) loadAboutUs
{

    AboutUs *about = [self.storyboard instantiateViewControllerWithIdentifier:@"about"];
    [self.navigationController pushViewController: about animated: YES];
}

下一頁的class記得設 才能對應的程式頁




Identifier是關鍵 一定要與要推的下一頁的 屬性視窗Identifier相符


segue - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。