• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FSCopyObjectASync Not Calling Callback In Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FSCopyObjectASync Not Calling Callback In Cocoa


  • Subject: Re: FSCopyObjectASync Not Calling Callback In Cocoa
  • From: Steve Christensen <email@hidden>
  • Date: Wed, 30 Apr 2008 22:03:00 -0700

I noticed in some sample code (http://developer.apple.com/samplecode/ FSFileOperation/listing1.html), that after creating the FSFileOperationRef, it calls FSFileOperationScheduleWithRunLoop, specifying the current run loop. Just a guess that you're probably not making that association so the callback is never being called.


On Apr 30, 2008, at 5:42 PM, Matt Long wrote:

I execute this code and it successfully copies my file from source to destination:

- (IBAction)startCopy:(id)sender;
{
    FSFileOperationRef fileOp = FSFileOperationCreate(NULL);

    FSRef source;
    FSRef destination;

FSPathMakeRef( (const UInt8 *)[[sourceFilePath stringValue] cStringUsingEncoding:NSUTF8StringEncoding], &source, NULL );
Boolean isDir = true;
FSPathMakeRef( (const UInt8 *)[[destinationFilePath stringValue] cStringUsingEncoding:NSUTF8StringEncoding], &destination, &isDir );


    OSStatus status = FSCopyObjectAsync (fileOp,
                                &source,
                                &destination,
                                NULL,
                                kFSFileOperationDefaultOptions,
                                statusCallback,
                                1.0,
                                NULL);

    CFRelease(fileOp);

    if( status )
        NSLog(@"Status: %@", status);
}


status returns with no error. However my callback never gets called. Here's the callback.


static void statusCallback (FSFileOperationRef fileOp,
                                  const FSRef *currentItem,
                                  FSFileOperationStage stage,
                                  OSStatus error,
                                  CFDictionaryRef statusDictionary,
                                  void *info
)
{
[snip]
}


Any idea why?
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >FSCopyObjectASync Not Calling Callback In Cocoa (From: Matt Long <email@hidden>)

  • Prev by Date: Re: Immediate memory release
  • Next by Date: Converting From Simple to Doc Based App - Problems with Menus
  • Previous by thread: FSCopyObjectASync Not Calling Callback In Cocoa
  • Next by thread: TransformProcessType fails to show menu bar
  • Index(es):
    • Date
    • Thread