Odd notification / NSCFDictionary error

Stéphane Corthésy stephane at sente.ch
Fri Dec 7 09:20:21 PST 2007


Hi,

Do you have a NSAutoreleasePool inside (not around) your loop, and do  
you release it?

Stéphane

On 5 Dec 2007, at 05:21 , Chad Armstrong wrote:

> I have an application which loops an arbitrary number of times  
> (depending on the number of files being handled), which calls an  
> NSTask.  I'm encountering an odd error with pre-Leopard systems  
> where if my program loops around 200 times, the following error is  
> called.
>
> 2007-11-26 13:43:29.137 MyApp[3595] Exception raised during posting  
> of notification.  Ignored.  exception: *** -[NSCFDictionary  
> setObject:forKey:]: attempt to insert nil value
>
> I've done some research, but I cannot find anything which seems to  
> pin point this particular problem.  My guess is that this error is  
> being thrown when an NSTaskDidTerminateNotification is called after  
> the task is complete.  What I've been able to dig up on this  
> "notification exception" might be related to "too many files being  
> opened at once".
>
> Another odd thing about this situation is that I cannot reproduce  
> the problem on Leopard.  However, on earlier systems (Tiger,  
> Panther, and Jaguar), the problem exists.  This is a pre-existing  
> issue, so it is not something that happened after building on  
> Leopard or anything along those lines.
>
> In my code, I also do make one call to an NSMutableDictionary, which  
> does have a [NSDictionary setObject: forKey:] call, but that doesn't  
> seem to be the source of the problem since I eliminated that code,  
> and the problem persists.
>
> Any ideas?
>
> Regards,
>
> Chad
>
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev at omnigroup.com
> http://www.omnigroup.com/mailman/listinfo/macosx-dev



More information about the MacOSX-dev mailing list