• 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: NSOperation communicating progress?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOperation communicating progress?


  • Subject: Re: NSOperation communicating progress?
  • From: Mike Abdullah <email@hidden>
  • Date: Mon, 04 Feb 2013 23:09:02 +0000

On 4 Feb 2013, at 22:35, Todd Heberlein <email@hidden> wrote:

>
>> Again, everything seems to work fine. The one problem is I get the following warning at the very end:
>>
>> 	CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
>
> To close out this discussion in case anyone runs across it in the future trying to debug the same thing. I had multiple errors, but the final one was that I had registered to be notified when my NSInvocationOperation finished.
>
>    [myOp addObserver:self forKeyPath:@"isFinished" options:NSKeyValueObservingOptionNew context:NULL];
>
> And then in my method
>
> - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
>
> I closed a window that had an NSProgressIndicator. The problem is that the method is actually called not on the main thread (I think it was the thread created to process my NSInvocationOperation). Closing these GUI objects from this other thread seemed to be the final problem generating the warning above.
>
> I moved the code to another method, -finishedReadingAuditFile, and then created another NSInvocationOperation to call it on the main thread
>
> NSInvocationOperation   *tmpOperation;
> tmpOperation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(finishedReadingAuditFile) object:nil];
> [[NSOperationQueue mainQueue] addOperation:tmpOperation];

Out of interest, is there any reason why you're shying away from blocks here? They make this sort of code much simpler to write.


_______________________________________________

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: 
 >NSOperation communicating progress? (From: Todd Heberlein <email@hidden>)
 >Re: NSOperation communicating progress? (From: Todd Heberlein <email@hidden>)

  • Prev by Date: Re: NSOperation communicating progress?
  • Next by Date: Re: NSOperation communicating progress?
  • Previous by thread: Re: NSOperation communicating progress?
  • Next by thread: Re: NSOperation communicating progress?
  • Index(es):
    • Date
    • Thread