Re: Block until block is called

2011-08-27 Thread Brian Norh
On Sat, Aug 27, 2011 at 9:13 AM, Andreas Grosam wrote: > Uhm, if the reason for this rare case is to avoid race conditions, you should > rethink your design  ;) > Your design is OK if you have no race conditions, at any legal usage of your > API. Of course, you could say "This API is not thread

Re: Block until block is called

2011-08-26 Thread Brian Norh
On Sat, Aug 27, 2011 at 7:07 AM, Glenn L. Austin wrote: > Um, why would you want to (or need to) do that? It's often not necessary at all but I've found a very rare case where if the API is called from within another block it sometimes makes sense to do that, at least for now until the API is up

Block until block is called

2011-08-26 Thread Brian Norh
Hi. I'm working against an API which looks like this: - (void)performOperationWithBlock:(void (^)(void))block The call returns directly and the execution continues. At some point the block is eventually called. How would I do to block execution until the block have been called? [obj performOper

Specify valid values for a Core Data attribute

2011-08-19 Thread Brian Norh
Hello. When I'm using Core Data I'm sometimes in a situation where I have an attribute than can only have a specific set of possible values. As an example let's say that you make a bug tracker and you have an entity called Bug. Then it's possible that you want an attribute for the state that the b

Release a NSWindowController after the window is closed

2011-06-17 Thread Brian Norh
Hello. I'm building a Cocoa application and have a question about using window controllers. The idea is that when the user selects New from the File menu, an instance of MyWindowController which is a subclass of NSWindowController is created and a new window from MyWindow.xib is displayed. I'm ha