On Sun, Nov 7, 2010 at 6:06 PM, gMail.com <mac.iphone....@gmail.com> wrote: > > A quick question more please. > As I have seen on the Apple sample code "FSFileOperation", > I can wait until FSCopyObjectAsync is done, using CFRunLoopRunInMode. > > while(!gFileCopiedDone && !mUserPressedStop){ > CFRunLoopRunInMode(kCFRunLoopDefaultMode, 5.0, true); > } > if(mUserPressedStop){ > FSFileOperationCancel(fileOp); > return -12; > } > > The user can press a button and set mUserDidStop = YES; > and I set the gFileCopiedDone to YES in the callback method, > when stage == kFSOperationStageComplete > > Since I have several files to copy, one by one, this way I can better manage > each single copy. Everything seems to work flawlessly. But, I ask, do you > think it's ok with the Mac standards? I mean, I have checked and the menu > works, the other apps work... Could this waiting loop cause some problem?
Since the menu works - what happens if the user quits the app? You might want to call FSFileOperationCancel() then too, to make sure the partial copy gets cleaned up before your app exits. sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com