tags:

views:

30

answers:

1

Hi all,

I am parsing an xml, and showing the parsed data into Tableview. Untill the data is fully parsed, i show a activityIndicator ,to user. As the data gets loaded, i make activityIndicator stop. The problem is, if user hits back button before the xml gets parsed, my app gets crashed.

What should i do prevent user to go back,untill table view come up with fully parsed data. or if user hits back before the xml gets parsed,my app shouldnt be crashed.

w8ing for reply

thanks and hv a nice day

+1  A: 

Before starting the activityIndicator disable the user interaction of your view and enable it after stopping the indicator.

Say myView is the view that contains the button, table view etc. Then before start :

[myView setUserInteractionEnabled:FALSE]

And after stop :

[myView setUserInteractionEnabled:TRUE]
taskinoor
Thank mate,its working,but didnt get wat is happening here.My app is not crashing,but user interaction is disble untill the table gets filled,i can move back,at the time of filling of tableview.....
shishir.bobby
This is basically disabling the user interaction until your table gets filled. If you disable the interaction of a view, all subviews also disable.
taskinoor
i hv tabs in this , tabs are still enteractable./......
shishir.bobby
then u need to find the view in the hierarchy that is superview for all of them and disable that. main window (window instance in app delegate) is the super view of all views. if u disable the interaction of main window then every interaction will be disabled.
taskinoor