tags:

views:

178

answers:

1

Hi,

i have NSobject page inwhich i have method to reload table like

MainPageTable *m = [[ MainPageTable alloc] init];
[m.tableView reloadData];
[m release];

The following is called:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

but this is not:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

any help please?

+1  A: 

mm. reloadData is a standart tableView's method. after this call your tablewView asks it's delegate and dataSource about info it's need to be reloaded as numbers of sections in the table after reload, new cells, etc.

Morion
yes,section returns 10, i checked through break point, but when i putbreak point on cellForRowAtIndexPath ,it will not be worked....any help please?
Mikhail Naimy
new cells will not be displayed after reloading
Mikhail Naimy
hmm. maybe you put breakpoint in some, for exaple, if block? or it is in the beginning of cellForRowAtIndexPath? is this method called when you load your table at the first time?
Morion
YES..it works first time. after i changed its section to 10 from NSObject ,then the break point goes to numberOfRowsInSection correctly(changed) then the break point( already worked ) is not worked, it did not get new cells(already worked) will you please help?
Mikhail Naimy
ok. first of all - why do you create new object to relod data? if you already have your page, you may not crate it to call reloadData. if you just created your page, your table will ask it's delegate and dataSource methods automatically. second. if you have created your table in IB, then it can just has no enough time to load and you send reloadData to nil object. check it in debugger and post results.
Morion
bcos i have xmlparser page(nsobject page) in which , after finishingxml parsing i need to create object for that tableview,and then i call reload data.how can i post debugger result?what it means? will you please?
Mikhail Naimy
i have tableview in IB...what i have to do?
Mikhail Naimy
how can i avoid reloadData to nil object?
Mikhail Naimy