Re: Fielding a mouseDown in a textField

2012-04-04 Thread Graham Cox
On 05/04/2012, at 9:51 AM, Charlie Dickman wrote: > Good people, > > How do I go about fielding a mouseDown event in an NSTextField? For what purpose? NSTextField generally works without you having to do anything special. If you have some unusual requirement, you'll need to tell us what it

Re: Placing Cells in an NSMatrix

2012-04-04 Thread Erik Stainsby
Small bit if knowledge to share. The stroke of the border is drawn centred over the line of the border. So your described 4pt line would intrude 2pts into the bounded area. I'm know if that will help any with understanding the left-shifting you have observed. Erik Stainsby erik.stain...@roaring

Re: Placing Cells in an NSMatrix

2012-04-04 Thread Peter Teeson
On 2012-04-04, at 6:52 PM, Peter Teeson wrote: > On 2012-04-04, at 5:02 PM, Fritz Anderson wrote: >> On 4 Apr 2012, at 2:20 PM, Peter Teeson wrote: >>> Given a 3 x 3 Matrix which is a sub-class of NSMatrix with Cells >>> sub-classed from NSButton >>> the X origins of column 0 cells seem to be 1.0

Fielding a mouseDown in a textField

2012-04-04 Thread Charlie Dickman
Good people, How do I go about fielding a mouseDown event in an NSTextField? Charlie Dickman 3tothe...@comcast.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact t

Help debugging EXC_BAD_ACCESS

2012-04-04 Thread Rick Mann
This is odd. I have an app that downloads locations from a web service, and creates NSManagedObejct (subclass: Location) for them. It's been working fine on simulator and device. Suddenly, I get a consistent EXC_BAD_ACCESS on device and simulator every time I create a new location (existing loca

Re: Using NSView fullscreen mode vs. autolayout constraints

2012-04-04 Thread Kevin Cathey
This should "just work", of course that depends on the project. Please file a bug and attach the project you're seeing this with. Kevin On 3 Apr 2012, at 18:11, douglas welton wrote: > Hi All, > > [I've read the Cocoa Autolayout release notes and googled for "NSView > autolayout fullscreen"

Core Data migration, what to do when adding the nth version of your model?

2012-04-04 Thread Sean McBride
Hi all, My Mac app currently has 3 versions of my xcdatamodel. I have explicit .xcmappingmodels for 1->3 and 2->3 (they pre-date lightweight migration). I now need to create version 4. Let's assume it's a trivial change from 3. Thus, I hope to do 3->4 with lightweight migration. In fact, cu

Re: Placing Cells in an NSMatrix

2012-04-04 Thread Peter Teeson
On 2012-04-04, at 5:02 PM, Fritz Anderson wrote: > On 4 Apr 2012, at 2:20 PM, Peter Teeson wrote: >> Given a 3 x 3 Matrix which is a sub-class of NSMatrix with Cells sub-classed >> from NSButton >> the X origins of column 0 cells seem to be 1.0 point inside the Matrix >> bounds. >> >> So if I w

Re: Placing Cells in an NSMatrix

2012-04-04 Thread Fritz Anderson
On 4 Apr 2012, at 2:20 PM, Peter Teeson wrote: > Given a 3 x 3 Matrix which is a sub-class of NSMatrix with Cells sub-classed > from NSButton > the X origins of column 0 cells seem to be 1.0 point inside the Matrix bounds. > > So if I want to stroke the Matrix bounds with a line width of e.g. 4

Placing Cells in an NSMatrix

2012-04-04 Thread Peter Teeson
Xcode 4.3, Lion 10.7.3 Given a 3 x 3 Matrix which is a sub-class of NSMatrix with Cells sub-classed from NSButton the X origins of column 0 cells seem to be 1.0 point inside the Matrix bounds. So if I want to stroke the Matrix bounds with a line width of e.g. 4.0 points it draws over the left a

Re: exception in init

2012-04-04 Thread Jens Alfke
On Apr 4, 2012, at 11:48 AM, Klaus Backert wrote: > Just to be sure what you mean: What is a real error? Simply an error which is > not a programmer's (or programming?) error? A runtime error, one that could occur in a valid program. What this means exactly is up to the designer of the API. F

Re: exception in init

2012-04-04 Thread Klaus Backert
Hi, On 4 Apr 2012, at 19:39, Dave wrote: Hi, If it's a real error ... If it's a programming error ... Just to be sure what you mean: What is a real error? Simply an error which is not a programmer's (or programming?) error? Regards Klaus ___

Re: exception in init

2012-04-04 Thread Jens Alfke
On Apr 4, 2012, at 10:33 AM, Corbin Dunn wrote: > "AppKit now has the ability to report uncaught exceptions. It is controlled > by a user default: NSApplicationShowExceptions (YES/NO). The default shipping > value is NO. In general, it is recommend that developers set it to YES during > develo

Re: exception in init

2012-04-04 Thread Dave
Hi, If it's a real error, this is what I do: - (id) initWithURL: (NSURL *) url { self = [super init]; if (self == nil) return nil; if (url == nil) { [self release]; return nil; } return self; } or in this case, you could just do this: - (id) initWithUR

Re: exception in init

2012-04-04 Thread Corbin Dunn
On Apr 4, 2012, at 9:29 AM, Andreas Grosam wrote: > The problem on Mac OS X in Cocoa Apps is, that there is no alert. The > application also does not stop, or terminate gracefully. The default behavior > of the event loop is to log an error message, and then **continue**. No, there is an aler

Re: exception in init

2012-04-04 Thread Corbin Dunn
On Apr 4, 2012, at 9:55 AM, Jens Alfke wrote: > > On Apr 4, 2012, at 9:29 AM, Andreas Grosam wrote: > >> The problem on Mac OS X in Cocoa Apps is, that there is no alert. The >> application also does not stop, or terminate gracefully. The default >> behavior of the event loop is to log an er

Re: exception in init

2012-04-04 Thread Jens Alfke
On Apr 4, 2012, at 9:29 AM, Andreas Grosam wrote: > The problem on Mac OS X in Cocoa Apps is, that there is no alert. The > application also does not stop, or terminate gracefully. The default behavior > of the event loop is to log an error message, and then **continue**. Not anymore. In Lion

Re: exception in init

2012-04-04 Thread Andreas Grosam
On Apr 4, 2012, at 5:57 PM, Jens Alfke wrote: > > On Apr 4, 2012, at 8:37 AM, Andreas Grosam wrote: > >> In a "debug" version, use NSAssert and friends (ensure Preprocessor macro >> "NS_BLOCK_ASSERTIONS" is not defined). Use Unit tests in order to detect >> *any* possible logic error. In a "r

Re: exception in init

2012-04-04 Thread Corbin Dunn
The general rule is: 1. If it is considered a programming error, raise an exception (or assert -- it is the same) 2. If it is normal code flow, then don't log or do anything strange. However, in general, it is troublesome to have init's return nil. corbin On Apr 4, 2012, at 4:38 AM, Ariel Fein

Re: exception in init

2012-04-04 Thread Jean-Daniel Dupas
Le 4 avr. 2012 à 17:57, Jens Alfke a écrit : > > On Apr 4, 2012, at 8:37 AM, Andreas Grosam wrote: > >> In a "debug" version, use NSAssert and friends (ensure Preprocessor macro >> "NS_BLOCK_ASSERTIONS" is not defined). Use Unit tests in order to detect >> *any* possible logic error. In a "re

Re: exception in init

2012-04-04 Thread Jens Alfke
On Apr 4, 2012, at 8:37 AM, Andreas Grosam wrote: > In a "debug" version, use NSAssert and friends (ensure Preprocessor macro > "NS_BLOCK_ASSERTIONS" is not defined). Use Unit tests in order to detect > *any* possible logic error. In a "release" version where NSAsserts and > friends may become

Re: exception in init

2012-04-04 Thread Jens Alfke
On Apr 4, 2012, at 4:38 AM, Ariel Feinerman wrote: > I think the question was asked and answered but I cannot see a clearance > what is the right way to write init in the cases the arguments are nil or > wrong? > Returning a nil or raising an exception? If the argument values are literally wrong

Re: exception in init

2012-04-04 Thread Andreas Grosam
On Apr 4, 2012, at 1:38 PM, Ariel Feinerman wrote: > Hi, > > I think the question was asked and answered but I cannot see a clearance > what is the right way to write init in the cases the arguments are nil or > wrong? > Returning a nil or raising an exception? Well first, this is my personal o

exception in init

2012-04-04 Thread Ariel Feinerman
Hi, I think the question was asked and answered but I cannot see a clearance what is the right way to write init in the cases the arguments are nil or wrong? Returning a nil or raising an exception? - (id) initWithURL: (NSURL *) url { if ((self = [super init])) { if (!url) { // ? } if (![