Phidget communication before Mac sleep

Supporting 10.7 and up
User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Phidget communication before Mac sleep

Postby Patrick » Wed Jun 01, 2011 3:01 pm

DoorManager *self = (id)userPtr; in the callback probably isn't the best idea, as 'self' is an objective-c keyword - I'm not sure if this will give you problems or not.

The rest looks ok.

You will definitely need to create an NSAutoReleasePool in the callback because it's not on the main thread - you may also want to performSelectorOnMainThread rather then calling the function directly - you can see all of this in the interfacekit Cocoa example (among others) for the sensor change event for example.

-Patrick

artnyoga

Re: Phidget communication before Mac sleep

Postby artnyoga » Wed Jun 08, 2011 9:14 pm

Thanks , all that you said has helped !! !!


Return to “macOS”

Who is online

Users browsing this forum: No registered users and 1 guest