Wednesday, 15 February 2012

ios - Data is disappearing from UITableView -


I am creating an iOS app with a custom tab bar at the top. When I click on the Home icon, I want it to show a tableview directly below the tab bar. At present my code does this, although the data is not displayed correctly. If I limit my cell 4 or less (number FoRowsInSection), will show data that I think that there are 15 cells, the figure shows a split second and then it disappears. I'm looking for tutorials on all the places and everything seems right, similar to the data will show the right way in a stand-alone scenes (like I story Singluwu application board and made it the opening scene). I do not know where I am wrong in my code below tableviewContoller class implementation file:

  - (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section {number of rows Return to section // 4th return; // This works ... but turning 15 does not work} - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {PrayerCell * cell = [tableView dequeueReusableCellWithIdentifier: @ "CustomCell "]; If (cell == zero) {NSLog (@ "cell is blue"); // The cell never kills = [[Prarthnakel light] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: @ "Kstmsel"]; } // display data is the correct data that I want to see cell.dName.text = [[News objectAtIndex: indexPath.row] objectForKey: @ "DisplayName"]; Cell.priority.text = [[[News objectattyxx: indexpath.ro] ObjectForcae: @ "primary"]; Cell.dateTime.text = [[[News object atindex: indexpath.ro] objectfore: @ "datetime"]; Cell.numPraying.text = @ "2 Prayers"; Cell.requestPreview.text = [[News object atindex: indexpath.ro] objectforekey: @ "request"]; NSLog (@ "created cell") // Verify that the cell was generated as a return cell; }   

Here is my PrayerCell.H file

  @interface PrayerCell: UITableViewCell @property (weak, nonatomic) IBOutlet UILabel * requestPreview; @ Property (weak, notatomic) IBotllet UILb * DNNn; @protterti (weak, nonetomic) IBotlet UILb * Datetime; @Property (weak, non-monocular) IBotrate ULLL * numPraying; @ Property (weak, non-primitive) IBotllet UILb * priority; @end   

I did not make any changes to the prayerCell.M file

if you need me to post any other code block / screenshot please me I know. Cell should not be an ivar, it should be a local variable cellForRowAtIndexPath:

  UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: @ "CustomCell"] You need to decompress cell in your  tableView;    

No comments:

Post a Comment