Re: __bridge_transfer on a method return value

2012-05-10 Thread Quincey Morris
On May 9, 2012, at 23:07 , Roland King wrote: > I'm using CFURLCreateStringByAddingPercentEscapes() because the NSString > version leaves '+' signs unescaped. If I used it directly in code I'd either > CFRelease it, or if assigned to an NSString, __bridge_transfer it. However I > want it as the

Re: saveDocument:

2012-05-10 Thread ecir hana
On Thu, May 10, 2012 at 2:24 AM, Graham Cox wrote: > > If you build a document-based app using Xcode's template, it will work > correctly from the very first time you run it. Then you can see how it's > put together, and all of these things will slowly become obvious. > I'm doing precisely this.

Re: Accessibility issues with NSPopover

2012-05-10 Thread Motti Shneor
Thanks, but the accessibility-dev is by itself arcane, to say nothing of Accessibility engineers.. :) I've been trying to get useful info there for many issues I had in the past, to no avail. I was hoping to have at least the non-accessibility issues helped here. does anybody know how to regai

Re: saveDocument:

2012-05-10 Thread ecir hana
On Wed, May 9, 2012 at 5:40 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > Very occasionally, it's necessary to subclass the NSDocumentController and > force the singleton to your own subclass, but this is rare. > > This is what I try to do - subclass the NSDocumentController i

Re: monitoring changes in a local property

2012-05-10 Thread Koen van der Drift
I'm going to re-read Chapter 31 and 32 of Hillegass' book, which more or less cover this subject (view swapping and core data relations). Briefly what he does is is adding a MOC property to each view controller, so its views can use that. I'll post back later. - Koen. On May 10, 2012, at 1

Re: saveDocument:

2012-05-10 Thread ecir hana
It works now! The problem was, that I was creating the window manager with "init:", instead of the initializers from the docs. Thank you all for the replies, they were very helpful! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Re: saveDocument:

2012-05-10 Thread Graham Cox
On 10/05/2012, at 7:12 PM, ecir hana wrote: > This is what I try to do - subclass the > NSDocumentController in applicationWillFinishLaunching:. Subclassing NSDocumentController is extremely rare, and in almost every case, unnecessary. If you're doing this as a matter of course because you thin

[MEET] CocoaHeadsNYC tonight (Thursday), 6:30PM

2012-05-10 Thread Andy Lee
Paul Kim will give a talk entitled "Let's Build A Text Editor". > In this talk, I'll touch on a couple different aspects of Cocoa's text system > in the context of a simple code editor. In particular, I'll show how to > display line numbers and do basic syntax coloring. Followed as usual by piz

[ANN] Online ScriptingBridge documentation archive

2012-05-10 Thread jonat...@mugginsoft.com
The ScriptingBridge is a great way to automate applications either from Obj-C or from a Cocoa language (either a bridge or a native implementation such as F-script or Nu). We are establishing an online archive of browsable ScriptingBridge and AppleScript derived documentation to assist with Coc

Re: __bridge_transfer on a method return value

2012-05-10 Thread Ken Thomases
On May 10, 2012, at 1:07 AM, Roland King wrote: > My confusion comes from not knowing whether this function now returns an > object with a +1 refcount or not. If it does it needs to be renamed to have > new or copy etc in the method name, or annotated properly to show that. I think you have thi

Re: __bridge_transfer on a method return value

2012-05-10 Thread Roland King
On May 10, 2012, at 11:54 PM, Ken Thomases wrote: > On May 10, 2012, at 1:07 AM, Roland King wrote: > >> My confusion comes from not knowing whether this function now returns an >> object with a +1 refcount or not. If it does it needs to be renamed to have >> new or copy etc in the method name

Re: __bridge_transfer on a method return value

2012-05-10 Thread Greg Parker
On May 10, 2012, at 8:54 AM, Ken Thomases wrote: > On May 10, 2012, at 1:07 AM, Roland King wrote: >> My confusion comes from not knowing whether this function now returns an >> object with a +1 refcount or not. If it does it needs to be renamed to have >> new or copy etc in the method name, or

Threads and Locking Question

2012-05-10 Thread Dave
Hi, We are using a third party library that performs tasks asynchronously. This is ok most of the time, but on some occasions I'd like to be able to wait (not on the main thread) until an operation completes, The flow basically goes like this: [theLibraryObject doOperation:myOperation w

Re: Threads and Locking Question

2012-05-10 Thread Dave
Should have added, this is for iOS and doesn't have to run on Mac. Hi, We are using a third party library that performs tasks asynchronously. This is ok most of the time, but on some occasions I'd like to be able to wait (not on the main thread) until an operation completes, The flow basi

Re: Threads and Locking Question

2012-05-10 Thread Ken Thomases
On May 10, 2012, at 3:42 PM, Dave wrote: > We are using a third party library that performs tasks asynchronously. This > is ok most of the time, but on some occasions I'd like to be able to wait > (not on the main thread) until an operation completes, This is usually an indication of a design p

Re: Threads and Locking Question

2012-05-10 Thread Conrad Shultz
On 5/10/12 1:42 PM, Dave wrote: > Hi, > > We are using a third party library that performs tasks asynchronously. > This is ok most of the time, but on some occasions I'd like to be able > to wait (not on the main thread) until an operation completes, > > The "doOperation: withCompletionBlock:" met

Re: Threads and Locking Question

2012-05-10 Thread Dave
Hi Ken, Thanks for that I will try it out tomorrow, as an aside, is this ok/ recommended? -(void) someMethod:(NSString*) theParameter { if ([NSThread isMainThread) { [self performSelectorInBackground:@selector(someMethod:) withObject:self]; return; } // Do work }

Re: Threads and Locking Question

2012-05-10 Thread Ken Thomases
On May 10, 2012, at 4:44 PM, Dave wrote: > Thanks for that I will try it out tomorrow, as an aside, is this > ok/recommended? > > -(void) someMethod:(NSString*) theParameter > { > if ([NSThread isMainThread) > { > [self performSelectorInBackground:@selector(someMethod:) > withObject

Re: Threads and Locking Question

2012-05-10 Thread Dave
On 10 May 2012, at 22:55, Ken Thomases wrote: As to whether it's OK/recommended, that depends. Why are you doing this? The caller of that method may be very surprised if it's asynchronous. No the caller is always expecting it to be ASync. It's just that I have to use a library that

First Responder

2012-05-10 Thread koko
I have a menu item connected to an action in First Responder; The action exists in an NSView subclass. The subclass implements acceptsFirstResonder and return YES. The subclass implements validateMenuItem and return YES; When the menu displays the menu item is disabled (set to enabled in IB).

Re: First Responder

2012-05-10 Thread Stephen J. Butler
On Thu, May 10, 2012 at 6:24 PM, koko wrote: > I have a menu item connected to an action in First Responder; > > The action exists in an NSView subclass. > > The subclass implements acceptsFirstResonder and return YES. > > The subclass implements validateMenuItem and return YES; > > When the menu

Re: First Responder

2012-05-10 Thread Erik Stainsby
I have had this happen when I have forgotten to declare my action method in the public header. Erik Stainsby erik.stain...@roaringsky.ca - On 2012-05-10, at 4:24 PM, koko wrote: > I have a menu item connected to an action in First Responder; > > The acti

Re: First Responder

2012-05-10 Thread koko
On May 10, 2012, at 6:05 PM, Stephen J. Butler wrote: > Does your subclass implement the action that the menu item is looking > for? Your view subclass won't be chosen as the first responder if it > doesn't implement the action Yes, the subclass implements the action. __

Re: First Responder

2012-05-10 Thread koko
On May 10, 2012, at 6:05 PM, Erik Stainsby wrote: > I have had this happen when I have forgotten to declare my action method in > the public header. The action is declared in the subclass header. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: First Responder

2012-05-10 Thread Erik Stainsby
Could you please paste the a copy of the method in a message? It is far easier to help you debug code which we can see than a description of something we cannot see. Erik Stainsby erik.stain...@roaringsky.ca - On 2012-05-10, at 5:07 PM, koko wrote: > >

Re: First Responder

2012-05-10 Thread Conrad Shultz
On 5/10/12 4:24 PM, koko wrote: > I have a menu item connected to an action in First Responder; > > The action exists in an NSView subclass. > > The subclass implements acceptsFirstResonder and return YES. > > The subclass implements validateMenuItem and return YES; > > When the menu displays t

Re: First Responder

2012-05-10 Thread Gregory Weston
koko wrote: > I have a menu item connected to an action in First Responder; > > The action exists in an NSView subclass. > > The subclass implements acceptsFirstResonder and return YES. > > The subclass implements validateMenuItem and return YES; > > When the menu displays the menu item is dis

Calculating layer's CATransform3D transformations

2012-05-10 Thread Kirill Kormiltsev
Hello, the questions are: 1. What equations are used to transform CALayers in 3D space and project their 2d point {x, y, z} to the 2D surface {x, y} ? All equations that I've found to project 3D points onto 2D space aren't the same with what CALayers use. My solve is to get one coordinate {x, y

architectures that prevent freezing

2012-05-10 Thread Ph.T
. in a pre-emptive OS there should be no freezing; given the new concurrency model that includes the use of the graphics processor GPU to do the system's non-graphics processing, my current guess is that the freezes happen when something goes wrong in the GPU, and the CPU is just waiting forever .