GUI Responsiveness with a Network Resource
GUI Responsiveness with a Network Resource
- Subject: GUI Responsiveness with a Network Resource
- From: Stephen Gerstacker <email@hidden>
- Date: Mon, 21 May 2007 19:28:12 -0400
I have a cocoa app that displays a list of pictures which are stored
across the network. The images a received via XML-RPC. If I click on
an item in the list, my Cocoa app:
1. Shows a spinning progress indicator
2. Sets up an XML-RPC call
3. Invokes the call in a new thread
4. The callback function puts the image in an ImageView
5. The progress indicator is stopped.
This works great, until I click on two list items in a row. This causes
a race condition and eventually seg faults the program.
I tried adding an NSLock that locks before the call is made and unlocks
after the picture is shown. This kind of works, until I click three
items in a row, which causes the GUI to hang.
So what would be the best way to handle this situation?
Please note: I come from a Windows/Linux world. Cocoa development has
been very different for me. Toolbar validation and ListView populations
have been very confusing, followed by very big 'Ah Ha!' moments.
- Stephen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden