Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Quincey Morris
On May 20, 2015, at 21:53 , Graham Cox wrote: > > I presume because the document owns its window controllers this must be weak > to avoid a retain cycle. That was my first thought, too, but then I realized that closing a document causes the ‘windowControllers’ array to be emptied, which would

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Graham Cox
> On 21 May 2015, at 2:41 pm, Quincey Morris > wrote: > > It looks to me like the problem is that the NSWindowController’s “document” > property is still set to the NSDocument object that was just deallocated. I'm > surprised to see that the “document” property is ‘assign’ rather than > ‘str

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Quincey Morris
On May 20, 2015, at 19:42 , Graham Cox wrote: > > or even just offer some general advice how to proceed It looks to me like the problem is that the NSWindowController’s “document” property is still set to the NSDocument object that was just deallocated. I'm surprised to see that the “document”

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Graham Cox
> On 21 May 2015, at 12:42 pm, Graham Cox wrote: > > I was able to record the problem running the app this way. That’s the good > news. The bad news is that I’m not really any the wiser. NSDocument is a > complex object that has become somewhat intractable of late. While I see the > same stac

Re: Tracking the retain count

2015-05-20 Thread Quincey Morris
On May 20, 2015, at 17:38 , Britt Durbrow wrote: > > We are, in fact, on the same page at this point! Yes, I think so too. But you’ve thereby done yourself out of the kittens. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Graham Cox
> On 20 May 2015, at 2:54 pm, Ken Thomases wrote: > >> At line 2, it’s clearly trying to access a NSWindow zombie. > > I'm not sure that's true. I think if the window were the zombie, the crash > would not show a frame in an NSWindow method, it would occur at the point > where that method wa

Re: Tracking the retain count

2015-05-20 Thread Graham Cox
> On 21 May 2015, at 10:38 am, Britt Durbrow > wrote: > > Also, generally speaking, I don’t want to have to go back to a manual > retain/release model for the whole app (which is basically what using > NSDiscardableContent entails; even though it isn’t literal -retain and > -release calls; t

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Eric Wing
On 5/20/15, Jens Alfke wrote: > >> On May 20, 2015, at 4:57 PM, Eric Wing wrote: >> >> It depends on how pedantic you want to be. > > As little as possible, honestly. Did you go back and read the original > question? The OP is having trouble with basic property-vs-ivar distinctions, > and droppin

Re: Tracking the retain count

2015-05-20 Thread Britt Durbrow
> > On May 20, 2015, at 10:32 AM, Quincey Morris > wrote: > > Turns out they weren’t so much off track as you need a smack upside the head. > [Er, wait, you’re a big dude with a beard, so perhaps kittens instead? You > like kittens? I don’t want to get hurt.] > Um… no; that was an example o

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 4:57 PM, Eric Wing wrote: > > It depends on how pedantic you want to be. As little as possible, honestly. Did you go back and read the original question? The OP is having trouble with basic property-vs-ivar distinctions, and dropping a whole bunch of science on him isn’

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Ken Thomases
On May 20, 2015, at 6:57 PM, Eric Wing wrote: > On 5/20/15, Jens Alfke wrote: >> >>> On May 20, 2015, at 4:08 PM, Eric Wing wrote: >>> >>> You could use the Objective-C runtime to find out which things are >>> properties. >> >> You could, but isn't it a lot easier to just look at the charact

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Eric Wing
On 5/20/15, Jens Alfke wrote: > >> On May 20, 2015, at 4:08 PM, Eric Wing wrote: >> >> You could use the Objective-C runtime to find out which things are >> properties. > > You could, but isn't it a lot easier to just look at the character before > the name and check whether it's a "."? > > --Jen

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Graham Cox
> On 21 May 2015, at 6:50 am, Michael David Crawford > wrote: > > In my own code I started with nothing but ivars, but changed some of > them to properties while neglecting to remove the original ivar. This > leaves me somewhat in the same situation as you. Nothing wrong with that, AS LONG a

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Michael David Crawford
If you have so many ivars, or so many properties that it's a lot of work to figure out which is which, quite likely you're doing something wrong. Now you're already refactoring your code, so you're doing something right there. It is quite common that well-done refactoring reduces the numbers of l

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 4:08 PM, Eric Wing wrote: > > You could use the Objective-C runtime to find out which things are properties. You could, but isn’t it a lot easier to just look at the character before the name and check whether it’s a “.”? —Jens ___

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Michael David Crawford
You could comment off their declarations in your header files, then have a look at which uses of them in your sources result in fatal compiler errors. (Comment off just one at a time.) Michael David Crawford, Consulting Software Engineer mdcrawf...@gmail.com http://www.warplife.com/mdc/ Availa

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Eric Wing
> Which are they, ivars or properties? > > I don't know. I can't tell. > > Is there any way to inspect an instance and tell if it is a property or an > ivar if both the property and ivar have the same name? > > Fun times, fun times. > You could use the Objective-C runtime to find out which things

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Michael David Crawford
there are good reasons to use properties that are backed by ivars, there are good reasons to use properties that aren't backed by anything, and there are good reasons to use ivars that are not properties. In my own code I started with nothing but ivars, but changed some of them to properties while

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Ken Thomases
Have to correct a typo: On May 20, 2015, at 3:22 PM, Ken Thomases wrote: > You are accessing a property if you use explicit message sending ([someObject > someProperty] or [someObject setSomeProperty:someValue]) or if you use > implicit message sending view dot syntax (someObject.someProperty)

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 1:04 PM, Alex Zavatone wrote: > > Many times in the classes, an ivar is defined in the @interface of the class. > Sometimes not. In the old days, before about 2006, the ivars had to be defined in the @interface. Nowadays it’s best to put them in the @implementation si

Re: Collection Views Breaking

2015-05-20 Thread Bill Monk
That's crashing because after going back, FirstViewController is using SecondViewController as it's collectionView's delegate & dataSource, resulting in messages to a dealloc-ed object. Turn on NSZombies to see this. This appears to happen because when going Back from your SecondViewController'

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Ken Thomases
On May 20, 2015, at 3:04 PM, Alex Zavatone wrote: > Many times in the classes, an ivar is defined in the @interface of the class. > Sometimes not. Then sometimes, the same name of the ivar is used in the > class and defined as a property and @synthesized. > > Sometimes not. > Now, I remembe

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread David Duncan
> On May 20, 2015, at 1:04 PM, Alex Zavatone wrote: > > In the code I've inherited, I've got the benefit of spending some time > refactoring and have an interesting situation. > > Many times in the classes, an ivar is defined in the @interface of the class. > Sometimes not. Then sometimes,

Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Alex Zavatone
In the code I've inherited, I've got the benefit of spending some time refactoring and have an interesting situation. Many times in the classes, an ivar is defined in the @interface of the class. Sometimes not. Then sometimes, the same name of the ivar is used in the class and defined as a pr

Re: NSNotificationQueue Question

2015-05-20 Thread Kyle Sluder
On Wed, May 20, 2015, at 12:59 PM, Jens Alfke wrote: > > > On May 20, 2015, at 10:18 AM, Richard Charles wrote: > > > > This works but the problem is that there are undesirable side effects to > > running the runloop once when this call is made. > > Yup. Manually spinning the runloop in any no

Re: Follow up to DatePicker Question

2015-05-20 Thread Mike Abdullah
> On 20 May 2015, at 21:07, David Grant wrote: > > So I found that what I really really wanted was not a popover controller but > an inputView. > > When I test this in an iPhone 6 it seems to work just fine, but on testing an > iPhone 5 the reaction to the date change is kind of slow. > > Al

Re: Collection Views Breaking

2015-05-20 Thread Kyle Sluder
On Wed, May 20, 2015, at 01:12 PM, Alex Zavatone wrote: > Whaaa? > > The app throws an exception, but setting an exception breakpoint never > gets triggered? EXC_BAD_ACCESS is a hardware exception. It has nothing to do with a software exception (the kind thrown by @throw or +[NSException raise],

Follow up to DatePicker Question

2015-05-20 Thread David Grant
So I found that what I really really wanted was not a popover controller but an inputView. When I test this in an iPhone 6 it seems to work just fine, but on testing an iPhone 5 the reaction to the date change is kind of slow. Also, this seems like a lot of code to make this work, so I’m submit

Re: NSNotificationQueue Question

2015-05-20 Thread Jonathan Taylor
> I have a bit of code that posts notifications to coalescing notification > queue. > [...] > In another place I need to force the notification queue to issue a did change > notification. > > This works but the problem is that there are undesirable side effects to > running the runloop once whe

Re: Collection Views Breaking

2015-05-20 Thread Alex Zavatone
Whaaa? The app throws an exception, but setting an exception breakpoint never gets triggered? Anyway, you may find these helpful. http://loufranco.com/blog/understanding-exc_bad_access http://www.touch-code-magazine.com/how-to-debug-exc_bad_access/ Enabling NSZombies may help you track that d

Re: NSNotificationQueue Question

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 10:18 AM, Richard Charles wrote: > > This works but the problem is that there are undesirable side effects to > running the runloop once when this call is made. Yup. Manually spinning the runloop in any non-custom mode is generally a bad idea. > What I would like to do

Re: Collection Views Breaking

2015-05-20 Thread Luther Baker
Thanks Alex, I have set an exception breakpoint but it never fires - and I will experiment with popping the second view controller programmatically and scrolling up. I think this has to do with my elementary understanding of how UICollectionViews are reused in this type of transition animation -

Re: Tracking the retain count

2015-05-20 Thread Quincey Morris
On May 20, 2015, at 01:41 , Britt Durbrow wrote: > > A memory pressure event occurs, and OPC decides to evict DMO1, but it doesn’t > immediately go away, because VC1 is holding on to it. > > VC2 comes along and wants to get at the object with UUID 12345 (in order to > execute [someObject stea

NSNotificationQueue Question

2015-05-20 Thread Richard Charles
I have a bit of code that posts notifications to coalescing notification queue. // Post did change notifications to a coalescing notification queue. // Notifications are coalesced that match both the notification name and // object. The notification is posted at the end of the current notification

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Kyle Sluder
On Tue, May 19, 2015, at 09:26 PM, Graham Cox wrote: > > Crashed Thread:0 Dispatch queue: com.apple.main-thread > > Exception Type:EXC_BREAKPOINT (SIGTRAP) > Exception Codes: 0x0002, 0x > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread

Re: Collection Views Breaking

2015-05-20 Thread Alex Zavatone
What if you issue the back programatically and then scroll up? It would be interesting to see just what gets unwired here. Have you set an exception breakpoint to tell you exactly what is breaking? On May 20, 2015, at 12:46 AM, Luther Baker wrote: > I've got a simple iOS project consisting of 2

Re: Tracking the retain count

2015-05-20 Thread Charles Srstka
On May 20, 2015, at 3:41 AM, Britt Durbrow wrote: > >> On May 19, 2015, at 8:37 PM, Graham Cox > > wrote: >> >> I think what the OP says he wants is that the cache can only release when it >> knows nobody else has a reference to an object as well, hence the tempt

Move a folder and update corresponding Finder sidebar favorite

2015-05-20 Thread Ben Staveley-Taylor
I’m having trouble moving folders around if there is a Finder sidebar favorite pointing to that folder — the favorite gets deleted sometimes, if it is a move rather than a rename. I’d like to find a robust method that updates the favorite to point to the new location. Suppose you have a folder

Re: Tracking the retain count

2015-05-20 Thread Roland King
> On 20 May 2015, at 20:00, Dave wrote: > > I’ve been read this thread with interest, I think you are over-complicating > things, unless I missed something. …. > Isn’t this what you want to achieve? No that’s not what he wants to achieve. He wants 1) When he needs an object pertaining to a

Re: Tracking the retain count

2015-05-20 Thread Dave
I’ve been read this thread with interest, I think you are over-complicating things, unless I missed something. Look at the following pseudo code: // Create a New Payload Object LTWPayloadItem* myPayloadItem; //An object that contains references to other objects NSString*

Re: Tracking the retain count

2015-05-20 Thread Britt Durbrow
In no particular order: > On May 19, 2015, at 8:37 PM, Graham Cox wrote: > > I think what the OP says he wants is that the cache can only release when it > knows nobody else has a reference to an object as well, hence the temptation > to peek at the retain count. In other words it must be the

Animating NSSplitViewItem with CAAnimation

2015-05-20 Thread Dragan Milić
I’m trying to use SplitViewController/NSSplitViewItem (both new in OS X 10.10) objects combo to control NSSplitView instances in my application. First off, even though I’ve got the latest version of Apple documentation installed, it completely omits NSSplitViewItem reference. That class is only