Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My mobile app theme is just like default Gallery application in the mobile with some privacy settings applied. All logic's are done and works well. But, the problem facing when applying ideal presentation. We want to presenting the UIActivityIndicatorview / MBProgressHud(from Github) when the item's write to app path, move the items between folder which created in app path.

See design:

// start animation for loading
for(item in items[]){
// logic code:
// code for write items to app path(like asset type to NSData)
// or code for moving item's between folder which is in app path
// stop animation after handle last item
}

However, the animation stopped quickly because we know that the file operation and remaining compilation synchronously happened. BUT, my app wants some presentation to defining the user must wait until the given operation not complete.

* What could i do for this requirements?
* If the GCD is handy tool means, which GCD type is helpful for me?

Am too weak in English. Please adjust.

NOTE: Item's means Photo's and video's.
Posted
Updated 1-May-15 8:45am
v3

1 solution

My advice would be to

- start animation
- start a worker thread which does all the work
- the worker thread is signaling that the job is done, this stops the animation.

Here is some sample code from Ray Wenderlich. The addOperationWithBlock call looks like taylored for you.

I prefer GCD more for C-API and try to avoid it with the Cocoa classes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900