0

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 crashed.

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

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.