简体   繁体   English

将数据从表视图传递到视图控制器

[英]Pass data from table view to view controller

i have a table view that lists data from a parse.com class i want to pass the data that the person clicks and display the whole row formatted in a view controller on the next page 我有一个表视图,其中列出了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;
  }

in the Exibitor row there is comapny name address web site (that i want to be a link) phone number. 在Exibitor行中,有公司名称地址网站(我想成为链接)电话号码。 and more. 和更多。

so say the user click Exibitor number 1 the next page will open it will be a view controller with all the information. 所以说用户单击Exibitor number 1,将打开下一页,它将是具有所有信息的视图控制器。

Just pass the array[row selected] result to next view controller and parse your detail to populate your view controller. 只需将array [row selected]结果传递给下一个视图控制器,然后解析您的详细信息以填充视图控制器。 Also this is that array with which you populate your tableview Controller. 这也是您用来填充tableview Controller的数组。 Anything else then let me know 然后让我知道

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM