Using Lion's "Resume" for storing the last application state

2011-10-01 Thread Nick
Hello Are there any simple examples available that demonstrate how to use NSWindowRestoration protocol? What I am trying to do is to create a simple NSDocument based application with an NSTextView and a button to set the textview's background color. When the application is quit and launched again

combining two entities to one binding

2011-10-01 Thread Koen van der Drift
In my core data model, I have several string properties that I would like to bind to one NSTextView. So, I would like the text view to show both the name and description entities as if they were one string. Is there a way to do this, in IB I can only bind one at the time (I think). Thanks, - K

Re: combining two entities to one binding

2011-10-01 Thread Keary Suska
On Oct 1, 2011, at 11:54 AM, Koen van der Drift wrote: > In my core data model, I have several string properties that I would like to > bind to one NSTextView. So, I would like the text view to show both the name > and description entities as if they were one string. > > Is there a way to do th

How to make Lion's autosaving work for my application?

2011-10-01 Thread Nick
I have an NSDocument based app with a simple NSTextView, and I'd like to have all my windows opened and text loaded into NSTextView when the app is launched as it was before closing the application (just like Text Edit does). How can I do the same in my application? Currently I am using - (void)

Re: How to make Lion's autosaving work for my application?

2011-10-01 Thread Quincey Morris
On Oct 1, 2011, at 13:56 , Nick wrote: > I was hoping this Autosave feature > could help me do it easier. Hoping at random isn't likely to help you do anything easier (though if it does, you can probably write a profitable self-help book). Also, expecting us to do your basic research for you is

NSOperationQueue: -waitUntilAllOperationsAreFinished and -setSuspended:

2011-10-01 Thread Kyle Sluder
Hi all, Can't find an answer to this in the documentation. Does -waitUntilAllOperationsAreFinished pay heed to the -isSuspended state of the NSOperationQueue? I ask because I'm basically following this pattern to collect responses from multiple concurrent background operations in a thread-safe way

Re: How to make Lion's autosaving work for my application?

2011-10-01 Thread Nick
I did that basic research, and i've read the NSWindowRestoration.h before (which is not very circumstantial). The hoping stemmed from the keywords I've been advised to use by other developers and that small number of articles and blogs I could find. I have also read AppKit release notes. Unfortuna

Re: NSOperationQueue: -waitUntilAllOperationsAreFinished and -setSuspended:

2011-10-01 Thread Quincey Morris
On Oct 1, 2011, at 15:06 , Kyle Sluder wrote: > NSOperationQueue backgroundQueue = /* some long-lived background queue */; > NSOperationQueue replyQueue = [NSOperationQueue new]; > int totalResult = 0; > > [replyQueue setSuspended:YES]; > > for (id foo in myFoos) { > [backgroundQueue addOperati

Re: NSOperationQueue: -waitUntilAllOperationsAreFinished and -setSuspended:

2011-10-01 Thread Stevo Brock
What about removing replyQueue altogether, have the background operation add it's result processing back into backgroundQueue and just wait on backgroundQueue to finish? -Stevo On Oct 1, 2011, at 3:44 PM, Quincey Morris wrote: > On Oct 1, 2011, at 15:06 , Kyle Sluder wrote: > >> NSOperationQ

Re: How to make Lion's autosaving work for my application?

2011-10-01 Thread Quincey Morris
On Oct 1, 2011, at 15:14 , Nick wrote: > Unfortunately I do not have Apple developer's account. When I try to access the videos while logged out, it offers a free "Apple Developer" registration, which is apparently different from a "Mac Developer" or "iOS Developer" registration, both of which

Re: NSOperationQueue: -waitUntilAllOperationsAreFinished and -setSuspended:

2011-10-01 Thread Kyle Sluder
On Sat, Oct 1, 2011 at 3:44 PM, Quincey Morris wrote: > > Aren't you missing a [replyQueue setSuspended: NO] in there somewhere? And > if you do that, aren't you then failing to wait for backgroundQueue to > empty? Yes, sorry. The call to -setSuspended: happens right before -waitUntilAllOperation

Adding info plist segment for code signing messes up NSBundle

2011-10-01 Thread Jim O'Connor
I have a helper tool which lives in Contents/MacOS along with the primary binary. The helper tool needs access to the resources in the bundle. Once I added the info plist text segment so I could sign the helper tool NSBundle won't work properly. [NSBundle mainBundle] now doesn't refer to the bun

Re: Adding info plist segment for code signing messes up NSBundle

2011-10-01 Thread Jerry Krinock
On 2011 Oct 01, at 19:33, Jim O'Connor wrote: > Is there some way to get the bundle for the actual surrounding app the way I > did before I added the info.plist to my helper apps binary? I went through this drill a couple years ago. There were gotchas with every option, and after some conside