Re: Minimal document-based app

2012-04-30 Thread Graham Cox
I see no merit in trying to make a "minimal" document based app, whatever that is. It's usually misguided to try and build UI in code, it saves you nothing and makes it much harder to get anywhere. Just start a new Cocoa app and use the project template for a document based app. It gives you th

Re: Tracking down SIGABRTs

2012-04-30 Thread Ahmet Karalar
Ray Wenderlich's website has a guide on tracking down SIGABRTs, it might help. It's a two part guide, for the second part just change the "1" at the end of the link to "2" http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1 On Mon, Apr 30, 2012 at 05:50, Alex Zavatone wrote: > I

Minimal document-based app

2012-04-30 Thread ecir hana
Dear list, I'm trying to understand how the things in Cocoa works but I'm struggling with one thing. I saw http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html and http://casperbhansen.wordpress.com/2010/08/15/dev-tip-nibless-development/ and I think I somewhat understood. Now, I wo

Any clues on what could cause this crash?

2012-04-30 Thread Gideon King
I received this crash report from a user, and have no idea where to look in my code for a cause. I'm assuming from the method names etc that it's having trouble when drawing a CALayer using OpenGL. I really do nothing strange in my code with CALayers. I have a whole bunch of CALayers in a layer

Converting CGPathAddArcToPoint (or NSBezierPath equivalent) to a fixed number of CGPathAddCurveToPoint calls

2012-04-30 Thread Gideon King
Hi, I am using the CAShapeLayer's ability to animate a path, but the start and end path need to have the same number of segments. I have been using CGPathAddArcToPoint to add the curves to my path. That translates to CGPathAddCurveToPoint calls behind the scenes, but sometimes it adds one curv

Re: Tracking down SIGABRTs

2012-04-30 Thread Scott Ribe
On Apr 30, 2012, at 12:00 PM, Jens Alfke wrote: > On Mac OS the system will also put up the standard crash alert, whereas a > call to abort() (which is what assert() calls) just makes the app vanish with > no explanation to the user. Depends on the version perhaps? I certainly see abort() putti

Re: Tracking down SIGABRTs

2012-04-30 Thread Greg Parker
On Apr 30, 2012, at 11:00 AM, Jens Alfke wrote: > On Apr 29, 2012, at 8:00 PM, Don Quixote de la Mancha wrote: >> Place some assertions as the very first executable lines in each of >> your subroutines. > ... >> #include >> >> void foo( int *ptr ) >> { >> assert( NULL != ptr ); > > Ouch. Don’t

Re: Tracking down SIGABRTs

2012-04-30 Thread Sean McBride
>> void foo( int *ptr ) >> { >> assert( NULL != ptr ); > >Ouch. Don't use this in a Cocoa app; use NSAssert and NSParameterAssert >instead. You'll get much better reporting of the error, because you can >use custom messages with parameters, and the app will raise an exception >and log the backtra

Re: Tracking down SIGABRTs

2012-04-30 Thread Jens Alfke
On Apr 29, 2012, at 8:00 PM, Don Quixote de la Mancha wrote: > Place some assertions as the very first executable lines in each of > your subroutines. ... > #include > > void foo( int *ptr ) > { > assert( NULL != ptr ); Ouch. Don’t use this in a Cocoa app; use NSAssert and NSParameterAssert

Re: Tracking down SIGABRTs

2012-04-30 Thread Jens Alfke
On Apr 29, 2012, at 7:50 PM, Alex Zavatone wrote: > I've had the joy of trying to reassemble my app which a co worker improved > last week by moving it to storyboarding. What's popping up every now and > then as I try to wire views together are instant SIGABRTs with no indication > why this i

Re: Modal-loop Event-handling question

2012-04-30 Thread Jens Alfke
On Apr 30, 2012, at 1:24 AM, Motti Shneor wrote: > In our client-server app we sometimes present modal sheets on our main > window. Following server notifications we sometimes have to dismiss these > sheets (user is expelled, or otherwise status-changed). To me, dismissing a sheet without any

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Quincey Morris
On Apr 30, 2012, at 09:27 , Koen van der Drift wrote: > I am using an NSMutableArray to store the myObjects, the table > displays several properties of each object in seperate columns. So > the order in which the objects are stored in the array is not > critical, they will be ordered once display

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Koen van der Drift
On Mon, Apr 30, 2012 at 12:03 PM, Quincey Morris wrote: > What's at stake here is KVO compliance. If you have a class MyClass with an > indexed (array) property "things", you can implement the indexed mutable > accessors -- basically 'insertObject:inThingsAtIndex:' and > 'removeObjectFromThingsAt

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Quincey Morris
On Apr 30, 2012, at 04:53 , Koen van der Drift wrote: > Thanks for the link. I am confused now, since it says: > > "Indexed Accessor Pattern > [...] > There are indexed accessors which return data from the collection (the > getter variation) and mutable accessors > that provide an interface for m

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Koen van der Drift
Thanks for the link. I am confused now, since it says: "Indexed Accessor Pattern [...] There are indexed accessors which return data from the collection (the getter variation) and mutable accessors that provide an interface for mutableArrayValueForKey: to modify the collection." Which (I think) i

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Koen van der Drift
On Apr 29, 2012, at 8:45 PM, Keary Suska wrote: > Yes, it does, but only if the cell prototype has an NSNumberFormatter > attached to it. How did you apply the formatter? By dragging it in IB onto the cell of the column. - Koen. ___ Cocoa-dev mailin

Modal-loop Event-handling question

2012-04-30 Thread Motti Shneor
Hi all. In our client-server app we sometimes present modal sheets on our main window. Following server notifications we sometimes have to dismiss these sheets (user is expelled, or otherwise status-changed). We do this using the [mainWindow attachedSheet] endSheet]; However, If we do this whi