Field editor in view-based table

2013-04-12 Thread Martin Hewitson
Dear list members, I have an NSTextField in a row view of a view-based tableview and I see the following behavior: 1) to get the field editor to show I have to single click the text field and wait about 1s. 2) The field editor only shows if I click on a part of the text field where this is

Re: Is there a pattern for creating an object with global scope?

2013-04-12 Thread Alex Zavatone
FYi, it's advice, not advise. Advice is what you give, advise is the giving of advice. But I like Matt Galloway's singleton approach for a class you can import and use everywhere. http://www.galloway.me.uk/tutorials/singleton-classes/ On Apr 12, 2013, at 9:30 PM, YT wrote: > Perhaps my appro

Re: Is there a pattern for creating an object with global scope?

2013-04-12 Thread Jens Alfke
On Apr 12, 2013, at 6:54 PM, Scott Ribe wrote: > Yes, extremely easy, just "create" the var, as in: > > int gFoobar = 42; YT wants to create an object, which isn’t as straightforward because you can’t have an object literal in Objective-C. Instead you declare a global pointer and initialize

Re: Is there a pattern for creating an object with global scope?

2013-04-12 Thread Scott Ribe
On Apr 12, 2013, at 7:30 PM, YT wrote: > Is this even possible? Yes, extremely easy, just "create" the var, as in: int gFoobar = 42; Then reference it elsewhere as: extern int gFoobar; ***NOW*** whether or not this is a good thing to do, particularly for your preferences, and also some detai

Re: Is there a pattern for creating an object with global scope?

2013-04-12 Thread Graham Cox
On 13/04/2013, at 11:30 AM, YT wrote: > Perhaps my approach is wrong. Looking for advise. > > So I'd like to define a Class called Preference. > > In main.m I'd like to create an object called myPreferences before the code > line > > return NSApplicationMain(argc, (const char**)); is run; >

Is there a pattern for creating an object with global scope?

2013-04-12 Thread YT
Perhaps my approach is wrong. Looking for advise. So I'd like to define a Class called Preference. In main.m I'd like to create an object called myPreferences before the code line return NSApplicationMain(argc, (const char**)); is run; I assume the object myPreferences will persist the life of

Re: Restoring unsaved docs does wrong thing

2013-04-12 Thread Quincey Morris
On Apr 12, 2013, at 13:10 , Steve Mills wrote: > If I have an unsaved doc open in my app (I mean one that has never been saved > to disk), and I kill the app, upon relaunch, the OS attempts to restore that > document, but it does so incorrectly. First of all, the data was never saved > by the

Restoring unsaved docs does wrong thing

2013-04-12 Thread Steve Mills
If I have an unsaved doc open in my app (I mean one that has never been saved to disk), and I kill the app, upon relaunch, the OS attempts to restore that document, but it does so incorrectly. First of all, the data was never saved by the new Cocoa autosaving mechanism (we have our own and must

Re: Anyone seen [NSCursor set] crash by calling abort()?

2013-04-12 Thread Sean McBride
On Thu, 11 Apr 2013 18:56:24 -0500, Ken Thomases said: >Was anything written to the console log at this point? When the >frameworks abort, they often write a log message. Nothing in console. :( >Given that the abort is happening when attempting to obtain the >connection to the window server, is

Re: NSBrowser editItemAtIndexPath:withEvent:select:

2013-04-12 Thread Paul Wasmund
None of the suggestions panned out. The setting of the allowsBranchSelection had no effect on being able to edit the first row entry programmatically and neither did the isLeaf value. The other relevant values are: isEditable = 1 indexPath = 1 indexes [13] and those look good to me. Any othe

Re: Anyone seen [NSCursor set] crash by calling abort()?

2013-04-12 Thread Andy Lee
On Apr 11, 2013, at 2:57 PM, Sean McBride wrote: > I have an executable which runs fine on 10.7.5, but when run in 10.8.3 > crashes as below. This repros 100% on several machines. The cursor is > created plainly: [NSCursor pointingHandCursor], it happens with [NSCursor > crosshairCursor] too,

Re: presentViewController completion block usage

2013-04-12 Thread Koen van der Drift
On Apr 12, 2013, at 10:00 AM, Roland King wrote: > The completion block is really for your view controller to know when it is > entirely finished presenting or entirely finished dismissing a view > controller so that it can do some cleanup work, if it needs to. They often > don't. Got it! T

Re: presentViewController completion block usage

2013-04-12 Thread Roland King
On 12 Apr, 2013, at 9:50 PM, Koen van der Drift wrote: > > On Apr 12, 2013, at 9:30 AM, Roland King wrote: > >> Did you have a particular use-case in mind? > > I am using the modalVC to set/change parameters for a calculation. These > parameters are properties of the presentingVC, which a

Re: NSBrowser editItemAtIndexPath:withEvent:select:

2013-04-12 Thread Keary Suska
On Apr 4, 2013, at 3:13 PM, Paul Wasmund wrote: > I am trying to use editItemAtIndexPath:withEvent:select: in my program to > programatically start editing the text in my cell. It works for all items > except those in the first column. As an experiment I added code to the Apple > sample Complex

Re: presentViewController completion block usage

2013-04-12 Thread Koen van der Drift
On Apr 12, 2013, at 9:30 AM, Roland King wrote: > Did you have a particular use-case in mind? I am using the modalVC to set/change parameters for a calculation. These parameters are properties of the presentingVC, which also has a 'Start Calculation' button. So when I open the modalVC, the

Re: NSBrowser editItemAtIndexPath:withEvent:select:

2013-04-12 Thread Gary L. Wade
If the problem is with the index path, you could get selectedRowInColumn:0 and construct your own index path with the returned value. -- Gary L. Wade http://www.garywade.com/ On 4/4/2013 2:13 PM, "Paul Wasmund" wrote: >I am trying to use editItemAtIndexPath:withEvent:select: in my program to >p

Re: presentViewController completion block usage

2013-04-12 Thread Roland King
On 12 Apr, 2013, at 8:50 PM, Koen van der Drift wrote: > When a modal UIViewController is dismissed, Apple recommends to use the > delegate pattern to pass data back to the presenting UIViewController. I am > using that and it works just fine. But I was wondering if the same (passing > dat

presentViewController completion block usage

2013-04-12 Thread Koen van der Drift
When a modal UIViewController is dismissed, Apple recommends to use the delegate pattern to pass data back to the presenting UIViewController. I am using that and it works just fine. But I was wondering if the same (passing data back) can be achieved using the completion block. Right now, I just