tags:

views:

206

answers:

1

Hi,

I have two views with two tab means per view per tab and i m taking data from server. so i have to use viewDidAppear:(BOOL)animated.

In this method i add table, progress view and label and i have used "[self performSelectorInBackground:@selector(getDataFromServer:) withObject:string];" .

So when i select this view, it start to loading data in background and at time when i move to another view and come back to first, it override another table, label and progress view. how many times i select this view while loading from server, it will add that times table, label and progressview and then creashed.

What should i use with this view did appear from prevent this bugy things.

Pls.

Thanks.

A: 

Maybe it's problem on thread deallocation. What do you do when view disapear ? Do you free the view ?

Why not to load data using a thread in your AppDelegate and then provide these data to the current view.

In you current you have to know data are loading and then display a progress indicator. Data will be loaded only 1 time when view will be load from nib.

Hope that helps.

Thierry

thierryb