Re: Passing NSTextField Pointer to IOUSBInterfaceInterface182 Callback
Re: Passing NSTextField Pointer to IOUSBInterfaceInterface182 Callback
- Subject: Re: Passing NSTextField Pointer to IOUSBInterfaceInterface182 Callback
- From: Jens Alfke <email@hidden>
- Date: Thu, 11 Apr 2013 22:34:00 -0700
On Apr 8, 2013, at 3:07 PM, Caylan Larson <email@hidden> wrote:
> I'm doing an asynchronous read from a USB printer. The read works correctly. My trouble is updating a NSTextField from within the callback.
I don’t know the USB API, but I’d guess the callback gets invoked on some background thread, in which case you cannot call AppKit code from it. Your callback should instead dispatch a block to the main thread’s dispatch queue.
> &(_printerOutput)
Don’t use &. It should just be _printerOutput, or perhaps (__bridge void*)_printerOutput.
—Jens
_______________________________________________
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