0

i've a class SelezionaProfilo, in this class i've a list of players:

@interface SelezionaProfilo : UIViewController < UITableViewDelegate, UITableViewDataSource >  {

  UITableView *myTableView;
  //my staff
}

@property (nonatomic, retain) IBOutlet UITableView *myTableView;

all works fine.

i've built a subclass SelectPlayerViewController embeded in navigationcontroller, because i want to have a different reaction to push a row:

  @interface SelectPlayerViewController : SelezionaProfilo {

all works fine, i've the players list. And i have the different action.

in the SelectPlayerViewController.m i've added a button on navigation bar, add player button that goes to another class in push navigation. Now the player was created, but when the view come back to SelectPlayerViewController, i can't see the last player.

in SelezionaProfilo.m:

- (void)viewWillAppear:(BOOL)animated {   
    [self.myTableView reloadData];
    [super viewWillAppear:animated];
}

and in SelectPlayerViewController.m

- (void)viewDidAppear:(BOOL)animated {   
    [super.myTableView reloadData];
}

i'm sure that enter in this method, but the table doesn't refresh. I've a tabbar, and i've SelezionaProfilo in another tab, if i select this, i can see the last player, so the SelezionaProfilo class works fine.

can anyone suggets me? thaks

Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30
  • Try removing the `viewDidAppear:` method from SelectPlayerViewController and switching the order of the statements in SelezionaProfilo's `viewWillAppear:` method. (It may not fix the problem but it will make more sense.) Other than that, I'd suggest logging the value returned from `tableView:numberOfRowsInSection:` and seeing if it matches what you expect. – Phillip Mills Nov 15 '12 at 14:09
  • thaks for the answer, i cann't try now, my mac is at home. I can try to switching the order in viewWillAppear thi night. So i'm sure that the array will refresh, but it doesn't goes to the table view method, so the rows are one less. – Simone Pistecchia Nov 15 '12 at 14:21

1 Answers1

0

I resolved it!!! so if interest to someone....

i've a table view in the xib, i must connect it with File's Owner two Referencing Outlet:

view
myTableView
Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30