Skip navigation.
 
mlRe: Appending string to NSTextView crashing app
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

Related mailsAuthorDate
mlAppending string to NSTextView crashing app Evan Moseman Apr 25, 04:29
mlRe: Appending string to NSTextView crashing app Ryan Stevens Apr 25, 05:16
mlRe: Appending string to NSTextView crashing app Evan Moseman Apr 25, 05:24
mlRe: Appending string to NSTextView crashing app PGM Apr 25, 05:52
mlRe: Appending string to NSTextView crashing app Andy Lee Apr 25, 06:09
mlRe: Appending string to NSTextView crashing app Uli Kusterer Apr 25, 10:43
mlRe: Appending string to NSTextView crashing app Evan Moseman Apr 26, 04:42
mlRe: Appending string to NSTextView crashing app Evan Moseman Apr 26, 05:22
mlRe: Appending string to NSTextView crashing app PGM Apr 26, 05:27
mlRe: Appending string to NSTextView crashing app Evan Moseman Apr 27, 14:45