Re: Crashing Problem calling postNotificationName

2013-09-13 Thread Dave
On 12 Sep 2013, at 09:54, Graham Cox graham@bigpond.com wrote: On 11/09/2013, at 5:33 PM, Etienne Samson samson.etie...@gmail.com wrote: I think the best way for what you're trying to do is to subclass NSNotificationCenter (or at least provide your own framework-wide singleton that

Re: Crashing Problem calling postNotificationName

2013-09-13 Thread Dave
On 12 Sep 2013, at 17:58, Kyle Sluder k...@ksluder.com wrote: Whenever I see a suggestion like “subclass NSNotificationCenter”, I recoil in horror. First, NSNotificationCenter is a singleton. If you subclass it, you now must have two notification centers. It has the facility to have

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Etienne Samson
Hi ! I think the best way for what you're trying to do is to subclass NSNotificationCenter (or at least provide your own framework-wide singleton that quacks like it), wrap -postNotification: with some dictionary-munging code that keeps tracks of the last notification send by notification

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Graham Cox
On 11/09/2013, at 5:33 PM, Etienne Samson samson.etie...@gmail.com wrote: I think the best way for what you're trying to do is to subclass NSNotificationCenter (or at least provide your own framework-wide singleton that quacks like it), wrap -postNotification: with some dictionary-munging

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Etienne Samson
Le 12 sept. 2013 à 10:54, Graham Cox graham@bigpond.com a écrit : On 11/09/2013, at 5:33 PM, Etienne Samson samson.etie...@gmail.com wrote: I think the best way for what you're trying to do is to subclass NSNotificationCenter (or at least provide your own framework-wide singleton that

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Graham Cox
On 12/09/2013, at 11:17 AM, Etienne Samson samson.etie...@gmail.com wrote: If there's 26 different objects that need that cache capacity, that's 26 class methods So just make a tiny class for the sole purpose of storing the latest data state. All 26 different sender classes can then use it

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Dave
On 11 Sep 2013, at 15:11, dangerwillrobinsondan...@gmail.com wrote: On Sep 11, 2013, at 10:52 PM, Dave d...@looktowindward.com wrote: On 11 Sep 2013, at 14:22, Graham Cox graham@bigpond.com wrote: On 11/09/2013, at 3:13 PM, Dave d...@looktowindward.com wrote: Yes, but it

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Dave
On 12 Sep 2013, at 18:45, Kyle Sluder k...@ksluder.com wrote: No, just at the receiver, the sender need do nothing, in fact its unchanged. How? You need to update the sender to send to the correct notification center. Sorry, I mis-read this, I see what you mean now, I might have had to

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Dave
On 12 Sep 2013, at 20:24, Etienne Samson samson.etie...@gmail.com wrote: That's not true : you won't get notifications sent by the Cocoa framework, because it will use `[NSNotificationCenter defaultCenter]` and you have (obviously) no way to change the sender. I feel like I'm playing

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Etienne Samson
Le 12 sept. 2013 à 20:11, Dave d...@looktowindward.com a écrit : On 12 Sep 2013, at 18:45, Kyle Sluder k...@ksluder.com wrote: On Thu, Sep 12, 2013, at 10:18 AM, Dave wrote: On 12 Sep 2013, at 17:58, Kyle Sluder k...@ksluder.com wrote: Whenever I see a suggestion like “subclass

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Kyle Sluder
On Thu, Sep 12, 2013, at 10:18 AM, Dave wrote: On 12 Sep 2013, at 17:58, Kyle Sluder k...@ksluder.com wrote: Whenever I see a suggestion like “subclass NSNotificationCenter”, I recoil in horror. First, NSNotificationCenter is a singleton. If you subclass it, you now must have two

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Dave
Hi, Something that may be confusing people is that although LTWCachedNotificationCenter is defined as Sublass of NSNotificationCenter, it does NOT allocate itself as an object and it does not call Super, instead it calls [NSNotificationCenter defaultCenter] as in: -

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Dave
On 11 Sep 2013, at 16:33, Etienne Samson samson.etie...@gmail.com wrote: Hi ! I think the best way for what you're trying to do is to subclass NSNotificationCenter (or at least provide your own framework-wide singleton that quacks like it), wrap -postNotification: with some

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Kyle Sluder
Whenever I see a suggestion like “subclass NSNotificationCenter”, I recoil in horror. First, NSNotificationCenter is a singleton. If you subclass it, you now must have two notification centers. Which one is the right one to subscribe to? Do you only move notifications over to it that need to

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Manoah F. Adams
Hi Dave, With all the top coders getting fired-up/tangled up over this thread, I'm thinking we should get a better idea of the original situation you are dealing with. You talked in terms of when the object comes back 'alive' obviously the same programmatic object doesn't come back

Re: Crashing Problem calling postNotificationName

2013-09-12 Thread Dave
On 12 Sep 2013, at 18:45, Kyle Sluder k...@ksluder.com wrote: On Thu, Sep 12, 2013, at 10:18 AM, Dave wrote: On 12 Sep 2013, at 17:58, Kyle Sluder k...@ksluder.com wrote: Whenever I see a suggestion like “subclass NSNotificationCenter”, I recoil in horror. First, NSNotificationCenter

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Dave
Hi, Sorry for the lack of data in my original post! I Found the problem it was a Notification being sent to a dead object, it didn't happen very often, one crash after over an hour running continuously. I was more worried about the data I was passing not belonging to same thread (I recently

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Jerry Krinock
On 2013 Sep 11, at 04:35, Dave d...@looktowindward.com wrote: the problem it was a Notification being sent to a dead object Yup. Is there any problem with having all notifications handled by one object that doesn't go away, and have this ship the notificationa off to the correct object

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Graham Cox
On 11/09/2013, at 1:35 PM, Dave d...@looktowindward.com wrote: Is there any problem with having all notifications handled by one object that doesn't go away, Well, [NSNotificationCenter defaultCenter] is that object... and have this ship the notificationa off to the correct object as long

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Dave
On 11 Sep 2013, at 13:55, Graham Cox graham@bigpond.com wrote: On 11/09/2013, at 1:35 PM, Dave d...@looktowindward.com wrote: Is there any problem with having all notifications handled by one object that doesn't go away, Well, [NSNotificationCenter defaultCenter] is that object…

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Graham Cox
On 11/09/2013, at 3:13 PM, Dave d...@looktowindward.com wrote: Yes, but it doesn't remember the last value of a notification, which is what I would like. [] Yes, I am removing myself as a receiver, but ideally I want to receive these notification even if the object is dead. By this I

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Dave
On 11 Sep 2013, at 14:22, Graham Cox graham@bigpond.com wrote: On 11/09/2013, at 3:13 PM, Dave d...@looktowindward.com wrote: Yes, but it doesn't remember the last value of a notification, which is what I would like. [] Yes, I am removing myself as a receiver, but ideally I want

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread Gary L. Wade
On Sep 11, 2013, at 6:52 AM, Dave d...@looktowindward.com wrote: I mean when the object is created - at this point I want the latest version of the Notification, not the Notification when the Object Died. NSNotification and the various Center classes are meant to be used for loosely

Re: Crashing Problem calling postNotificationName

2013-09-11 Thread dangerwillrobinsondanger
On Sep 11, 2013, at 10:52 PM, Dave d...@looktowindward.com wrote: On 11 Sep 2013, at 14:22, Graham Cox graham@bigpond.com wrote: On 11/09/2013, at 3:13 PM, Dave d...@looktowindward.com wrote: Yes, but it doesn't remember the last value of a notification, which is what I would

Crashing Problem calling postNotificationName

2013-09-10 Thread Dave
Hi, I have a crashing problem when calling postNotificationName, the following method is called from an Operation Queue method/thread. It is called on the Main Thread (the operation queue method, uses performSelectorOnMainThread which calls parseOperationCompleted below. I've tried copying

Re: Crashing Problem calling postNotificationName

2013-09-10 Thread Pax
What do the debug logs for the crash say? At what point does the crash occur? Is your program getting into parseOperationComplete? When you step through, which line fails? On 10 Sep 2013, at 12:08, Dave d...@looktowindward.com wrote: Hi, I have a crashing problem when calling

Re: Crashing Problem calling postNotificationName

2013-09-10 Thread Jerry Krinock
On 2013 Sep 10, at 04:52, Pax 45rpmli...@googlemail.com wrote: What do the debug logs for the crash say? At what point does the crash occur? Is your program getting into parseOperationComplete? Yes, like Pax said, and also, assuming that Xcode stops and shows you a call stack, make sure

Re: Crashing Problem calling postNotificationName

2013-09-10 Thread Jens Alfke
On Sep 10, 2013, at 4:08 AM, Dave d...@looktowindward.com wrote: I have a crashing problem when calling postNotificationName Most of the time this happens because an object registered as an observer of that notification has been dealloced. Try running with NSZombieEnabled and, if this is the