Here's the deal: I have a navigation-based project with a menu screen as the root view. When I tap a button on the menu screen, the navigation controller pops a KalViewController onto the stack (kal calendar).
The calendar appears, and for about a 6 second period the calendar is downloading JSON data from the internet to populate the calendar with events. However, if the user taps Back (to go back to the main menu) during this time, the app crashes or the calendar continues to load the data even when I am on the main screen. (evidenced by the network activity indicator continuing to spin)1-- I was wondering if there is any way, when I tap the Back button, to cancel that download process so that my objects will release properly? (maybe using threads??)
OR 2-- Somehow prevent the user from tapping the back button while the data is still downloading. (Similar to how a UIAlertView prevents a user from clicking anything on the 开发者_StackOverflow中文版screen except for 'OK' to dismiss the alert message)PLEASE help! Thank you very much in advance!
精彩评论