-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storyboard / Runloop initialization race conditition #38
Comments
The SyphonServerDirectory never in its lifetime returns servers, or just in the vieDidLoad: method? |
Sorry, should have been more clear - It never returned a dictionary of server descriptions due to run loop nuances. We were able to solve by calling a performSelector and putting the server directory one run loop 'tick' after viewDidLoad for the storyboard view controller being available. basically. app launch Having Server Description return available servers in view did load fails, you get an empty dict. Waiting one run loop tick resolves the issue. Requesting during app did finish launching works as well. Its only the first unarchiving, view did load of a Storyboard where it fails - which felt odd :) |
Still not sure what is being described here. If it is simply that early in its lifetime a SyphonServerDirectory doesn't return servers, then is that a bug? We never want it to block waiting for responses from other applications, and you will have to deal with the arrival and disappearance of servers anyway through KVO or notifications, so it adds no extra work to the API user. I could update the documentation for SyphonServerDirectory with a note saying that early in the application lifetime, |
If I recall correctly, Its an initialization issue only with storyboards, where IIRC, -servers isnt just populated at application startup, but is never populated if you initialize within a storyboard view did load method. Its nothing to do with SyphonServerDirectories lifetime, only when and where it is initialized, if a runloop isnt available registration for notifications or some other mechanism appears to fail and the object does not ever updated -servers. Its similar to using Syphon on a thread w/o a run loop except you'd never expect it to happen in a Cocoa App whilst unarchiving / view did load (which works without storyboards last I looked). |
Ah, that is a bug. OK. |
Here's a storyboard-based app where I can't reproduce the bug (SyphonServerDirectory returns servers). If you could modify it to reproduce the bug, I'll take a look at it. |
Stupid bug, but @dlublin and I are working on a new Syphon enabled app, and on a View Controller View Did Load on a fresh OS X app with Storyboards, we could not get a SyphonServerDirectory to return any available servers.
Moving our Syphon Server Directory to app controller, Application Did Finish Launching makes it work, sans any other code changes
Speculation, but either an NSRunloop issue or some sort with NSDistributedNotifications aren't available / received in a timely fashion until App Did Finish Launching is fully completed.
Not so much a bug perhaps but a note of nuance.
Computers amirite?
The text was updated successfully, but these errors were encountered: