iphone - UITableViewController problems -


I have a table that has two table views table view of the same category that I have created which is a subclass of UITableViewController I believe that everything is tilted up properly though, when I set UITableView to UITableViewController, run

  [uitableviewcontrollervariablename reloadData];  

I get a warning for the first time that the class can not reload the answer to the data. I thought that all UITableViewControllers had a reloaded data class?

Am I trying to hook these things wrongfully?

Update with code: TopicViewController.h

  @interface TopicViewController: UIViewController {NSInteger topicID; Subject * subject; IBotlet Thoughtable Wii Controller * Featured; } @ Property (Maintaining) Topic * Subject; @property (read only) NSInteger topicID; @ Property (Maintained) IBOutlet Thoughtable Wii Controller * Featured; - (id) initWithNibName: (NSString *) nibNameOrNil bundle: (NSBundle *) nibBundleOrNil ID: (NSInteger) ID; @end  

TopicViewController.m

  @implementation TopicViewController @ synthesis topic; Modify @ theme; @ Synthesis attributes; - (id) initWithNibName: (NSString *) nibNameOrNil bundle: (NSBundle *) nibBundleOrNil ID: (NSInteger) ID {if (self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]) {topicID = ID; } Healthy return; } - (zero) Dailyock {[topic release]; [Super DeLoc]; } // Implement ViewDidLoad to perform additional setup after loading the view, usually from a nib. - (Zero) VisualElementsPaper: (BOOL) Animated {[Super ViewWhipper: Animated]; Subject = [[topic alloc] initWithID: topicID]; NSArray * idea = [topic getFeaturedThoughts]; Attributes = [[Thoughtable Wii Controller Alok] Init With Style: UTTualViewTilePlain Idea: Idea]; [Self. FeatureDotubeVRoadData]; } @end  

Your hookups are ok ... you just call that method The tablewyce class is not the controller:

[uitableviewcontrollervariablename.tablereviewRoadData]; Edit: 10/20/09
It's kind of hard to see what's going on because you're programming using IB instead of adding tables. , But hooks should be like this:

  • UIViewController is the owner of two UITableViews, two UITableViewControllers
  • UIViewController works as UITableViewDataSource, UITableViewDelegate
  • Asking for each table views to reload datasource will ask for data, In which you have to distinguish between two

    Here's how to program some code as an example:

      @interface whateverController: UIViewController & lt; UITableViewDelegate, UITableViewDataSource & gt; {... UITableView * tableView1; UITableView * tableView2; } @end  

    -

      @implementation WhateverController ... - (zero) loadView {[super loadView]; TableView1 = [[UITableView alloc] initWithFrame: CGRectMake (YOUR_FRAME_1)]; TableView2 = [[UITableView alloc] initWithFrame: CGRectMake (YOUR_FRAME_2)]; TableView1.delegate = self; TableView2.delegate = self; TableView1.dataSource = self; TableView2.dataSource = self; [Self.view addSubview: tableView1]; [Self.view addSubview: tableView2]; }   
    - (UITableViewCell *) Table view: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {if (tableView == tableView1) and if you return a cell using data for (tableView == tableView2) {// tableView2}}

    then data for others Return a cell using; UITableViewDelegate Methods and UITableViewDataSource methods will require you to populate 2 table views. When you want to reload the data:

      [reload tableView1 data]; [Reread tableview 2 table];  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -