PDA

View Full Version : How to Show a ProgressBar using NSFileManager copypath




imranpundeer
Jan 25, 2009, 01:43 AM
Hi Friends,
I am new in Cocoa programming. I want to display a progress bar on my window while coping a file using NSFileManager.

Actually in Windows there is a CopyProgressRoutine callabck function of CopyFile through which we can get the size that is being copied . So we can display a progress bar accordingly.

So is there any way in MAC to do this?

Any help would be appreciated.

Regards,
Imran.



HiRez
Jan 25, 2009, 03:13 AM
Generally you have to make your own, but it's not difficult. In Interface Builder, just put an NSProgressBar and NSTextField (for your progress info) onto an NSWindow or NSPanel and show the window while it's running, hide it when done. Use an NSTimer to update the bar and info periodically. You can also put a progress bar in your main window or just about anywhere you want, it doesn't have to be in a separate dialog.