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:
Here's how to program some code as an example: - 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: [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:
@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}}
[reload tableView1 data]; [Reread tableview 2 table];
Comments
Post a Comment