Note that there are some explanatory texts on larger screens.

plurals
  1. POTableView is not loading data?
    primarykey
    data
    text
    <p>In my Map application I have segment controller on main screen and using that I have Map View &amp; tableview(both are UIView). I have tried everything but my data is not loading in my tableview. Here is my tableview code. Here marker is attribute in my xml file which contain Showroom name and Iam able to parse this. .h file</p> <pre><code>@interface HViewController : UIViewController&lt;UITableViewDataSource, UITableViewDelegate&gt; { UITableView *_tableView; } @property (nonatomic, retain) IBOutlet UITableView *_tableView; @end </code></pre> <p>.m file</p> <p><strong>Edited</strong> = with ViewWillAppear,viewDieLoad, segement action method</p> <pre><code> @synthesize tableView; - (void)viewDidLoad { appDelegate = (HAppDelegate *)[[UIApplication sharedApplication] delegate]; [segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; } - (void)viewWillAppear:(BOOL)animated { self._tableView.rowHeight = 80.0; [_tableView reloadData]; } -(void)segmentAction:(id)sender;{ UISegmentedControl* segCtl = sender ; if( [segCtl selectedSegmentIndex] == 0 ) { NSLog(@"segmentAction mapView"); mapView.hidden = NO; _tableView.hidden = YES; //[ self.view addSubview:mapView] ; // adding view to segmentindex 0 } if( [segCtl selectedSegmentIndex] == 1 ) { NSLog(@"segmentAction _tableview"); _tableView.hidden = NO; mapView.hidden = YES; //[ self.view addSubview:_tableview] ; } } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"appDelegate.markers _tableview"); return [appDelegate.markers count]; } //method to print row(showroom count on Header) - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection: (NSInteger)section { if(section == 0) return [NSString stringWithFormat:NSLocalizedString(@"ShowRooms[%d]", @"Showroom format"), [appDelegate.markers count]]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath { static NSUInteger const kShowroomNameLabelTag = 2; UILabel *ShowroomNameLabel = nil; static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleGray; ShowroomNameLabel = [[[UILabel alloc] initWithFrame:CGRectMake(50, 1, 300, 20)] autorelease]; ShowroomNameLabel.tag = kShowroomNameLabelTag; ShowroomNameLabel.font = [UIFont boldSystemFontOfSize:18]; [cell.contentView addSubview:ShowroomNameLabel]; NSLog(@"UITableViewCell.markers _tableview"); } else { ShowroomNameLabel = (UILabel *)[cell.contentView viewWithTag:kShowroomNameLabelTag]; } marker *aMarker = [appDelegate.markers objectAtIndex:indexPath.row]; //ShowroomNameLabel.text = aMarker.name; ShowroomNameLabel.text= [NSString stringWithFormat:@"ShowroomName= %@", aMarker.name]; return cell; } </code></pre> <p>In my tableview Header it shows data count correctly but not showing data. I have connected delegate,datasource,_tableview to fileOwner of the HViewController in which I have put above code. Plz suggest something where I am wrong. I am parsing XML file and getting data in console alos I can show it on Map. But I am not able to load data in my tableview. <img src="https://i.stack.imgur.com/Hyfx2.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload