FROM : Evan Moseman
DATE : Fri Apr 27 14:45:19 2007
Very interesting, I didn't think of that. So maybe the notification
is not getting managed (memory wise) because of the functions that
are getting called? Not sure, but interesting.
Thanks for your help!
--
Evan
On Apr 25, 2007, at 11:27 PM, PGM wrote:
>
> On 25-Apr-07, at 22:42 PM, Evan Moseman wrote:
>
>> A button is linked to:
>>
>> - (IBAction)startAppButton:(id)sender
>> {
>> [self appendString:@"Starting notification event capture..."
>> toView:applicationTextView];
>> [[NSNotificationCenter defaultCenter]
>> addObserver:self
>> selector:@selector(appNotificationObserver:)
>> name:nil object:nil];
>> }
>>
>> The selector is this function:
>>
>> - (void)appNotificationObserver:(NSNotification *)note
>> {
>> NSLog(@"app note: %@", [note name]);
>> [self appendString:[note name] toView:applicationTextView];
>> }
>
> I do not know if this is causing the crash, but it seems to me that
> something akward should be happening here. You are registering your
> object to receive any notification sent by any object. You then
> place this notification in an NSTextView. This causes a
> NSTextDidChangeNotification to be sent, which in return is placed
> inside your NSTextView. This causes an infinite loop of
> notifications. If you only use NSLog, you don't have this problem
> as no notification is sent upon logging.
>
> Cheers, Patrick
DATE : Fri Apr 27 14:45:19 2007
Very interesting, I didn't think of that. So maybe the notification
is not getting managed (memory wise) because of the functions that
are getting called? Not sure, but interesting.
Thanks for your help!
--
Evan
On Apr 25, 2007, at 11:27 PM, PGM wrote:
>
> On 25-Apr-07, at 22:42 PM, Evan Moseman wrote:
>
>> A button is linked to:
>>
>> - (IBAction)startAppButton:(id)sender
>> {
>> [self appendString:@"Starting notification event capture..."
>> toView:applicationTextView];
>> [[NSNotificationCenter defaultCenter]
>> addObserver:self
>> selector:@selector(appNotificationObserver:)
>> name:nil object:nil];
>> }
>>
>> The selector is this function:
>>
>> - (void)appNotificationObserver:(NSNotification *)note
>> {
>> NSLog(@"app note: %@", [note name]);
>> [self appendString:[note name] toView:applicationTextView];
>> }
>
> I do not know if this is causing the crash, but it seems to me that
> something akward should be happening here. You are registering your
> object to receive any notification sent by any object. You then
> place this notification in an NSTextView. This causes a
> NSTextDidChangeNotification to be sent, which in return is placed
> inside your NSTextView. This causes an infinite loop of
> notifications. If you only use NSLog, you don't have this problem
> as no notification is sent upon logging.
>
> Cheers, Patrick
| Related mails | Author | Date |
|---|---|---|
| Evan Moseman | Apr 25, 04:29 | |
| Ryan Stevens | Apr 25, 05:16 | |
| Evan Moseman | Apr 25, 05:24 | |
| PGM | Apr 25, 05:52 | |
| Andy Lee | Apr 25, 06:09 | |
| Uli Kusterer | Apr 25, 10:43 | |
| Evan Moseman | Apr 26, 04:42 | |
| Evan Moseman | Apr 26, 05:22 | |
| PGM | Apr 26, 05:27 | |
| Evan Moseman | Apr 27, 14:45 |






Cocoa mail archive

