簡體   English   中英

將數據從表視圖傳遞到視圖控制器

[英]Pass data from table view to view controller

我有一個表視圖,其中列出了parse.com類中的數據,我想傳遞該人單擊的數據,並在下一頁上顯示在視圖控制器中格式化的整行

  - (id)initWithCoder:(NSCoder *)aCoder {
  self = [super initWithCoder:aCoder];
  if (self) {
    // Customize the table

    // The className to query on
    self.parseClassName = @"Exibitor";

    // The key of the PFObject to display in the label of the default cell style
    self.textKey = @"name";

    // The title for this table in the Navigation Controller.
    self.title = @"Exhibitor";

    // Whether the built-in pull-to-refresh is enabled
    self.pullToRefreshEnabled = YES;

    // Whether the built-in pagination is enabled
    self.paginationEnabled = YES;

    // The number of objects to show per page
    self.objectsPerPage = 6;
 }

 PFQuery *query = [PFQuery queryWithClassName:@"Exibitor"];
 //[query whereKey:@"playername" equalTo:@"Sean Plott"];
 [query countObjectsInBackgroundWithBlock:^(int count, NSError *error) {
    if (!error) {
        // The count request succeeded. Log the count
        NSLog(@"there are %d entries", count);
    } else {
        // The request failed
    }
 }];


 return self;
 }




 - (void)viewDidLoad
 {
 [super viewDidLoad];
 [self setTitle:@"Exibitor List"];


 // Uncomment the following line to preserve selection between presentations.
 // self.clearsSelectionOnViewWillAppear = NO;

 // Uncomment the following line to display an Edit button in the navigation bar for this view      controller.
 // self.navigationItem.rightBarButtonItem = self.editButtonItem;
  }

在Exibitor行中,有公司名稱地址網站(我想成為鏈接)電話號碼。 和更多。

所以說用戶單擊Exibitor number 1,將打開下一頁,它將是具有所有信息的視圖控制器。

只需將array [row selected]結果傳遞給下一個視圖控制器,然后解析您的詳細信息以填充視圖控制器。 這也是您用來填充tableview Controller的數組。 然后讓我知道

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM