[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: +[NSBundle mainBundle] broken for tools?

From: Roland Schwingel
Subject: Re: +[NSBundle mainBundle] broken for tools?
Date: Tue, 22 Jul 2003 13:01:18 +0200

> If your tool has no resources/mainBundle, then [NSBundle mainBundle]
> returns nil.
> If your tool has resources (which you set in your GNUmakefile by adding
> xxx_HAS_RESOURCE_BUNDLE = yes, and then using xxx_RESOURCE_FILES,
> xxx_LOCALIZED_RESOURCE_FILES etc), then you get back a bundle pointing to
> the installation directory containing those resources.
> That sounds pretty reasonable to me.
> What would you prefer it to return ?
Well.. I have to confess we are not having GNUstep makefiles in production
use (I just use them to initialy build gnustep-base library)... We have our
own ones. But in any case when no resources are specified or used and
+[NSBundle mainBundle] is called there is a call to [[NSBundle alloc]
initWithBundle:nil]. There NSBundle is deallocated which might be ok for
most tools (except for tools that assume to have some files aside the
executable (which I do not use here). But what in any case is very annoying
especially when you call some tools very often is the
      NSLog(@"No path specified for bundle");
call in -[NSBunde initWithPath:] soon before deallocating the NSBundle

But even in the case that the message is gone I like the idea of having a
NSBundle mainBundle as it gives a more complete installed GNUstep
impression, for the case I might have some resources aside the executable
sometime... And as far as I can remember (I hope my brain is working here)
OpenStep behaved the same. Even with just having a tool +[NSBundle
mainBundle] always returned an instance reflecting the tool itself.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]