bugGNUstep - Bugs: bug #10649, It is not possible to subclass...

Group
 
 

bug #10649: It is not possible to subclass NSBundle

Submitter:  Stefan Urbanek <stefanu>
Submitted:  Tue 12 Oct 2004 03:28:09 PM UTC
   
 
Category:  Base/Foundation Severity:  2 - Minor
Item Group:  Bug Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Declined
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 13 Oct 2004 06:22:47 PM UTC, comment #3: 

Is that a trick question?
If you want the behavior of a method in a subclass to differ from that of the superclass, you override the superclass behavior by implementing your preferred behavior in the subclass.
eg. if you wanted +bundleWithPath: to not return a cached bundle, you might re-implement it to create and return a new bundle instead.

Richard Frith-Macdonald <CaS>
Group Member
Wed 13 Oct 2004 06:12:34 PM UTC, comment #2: 

So how can I subclass NSBundle and make sure that I get the right class for requred bundle?

Stefan Urbanek <stefanu>
Group Member
Tue 12 Oct 2004 04:01:32 PM UTC, comment #1: 

In the first place, +bundleWithPath: will return instances of subclasses.

In the second place, there is no requirement that bundleWithPath: should return an instance of any particular class as it is explicitly documented (MacOS-X) as being free to return a cached NSBundle.

Richard Frith-Macdonald <CaS>
Group Member
Tue 12 Oct 2004 03:28:09 PM UTC, original submission:  

bundleWithPath: for any NSBundle subclass will return NSBundle  instance instead of subclass instance. It should return MyNSBundleSubclass instance instead.

Stefan Urbanek <stefanu>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-10-13 CaS Open/ClosedOpen Declined
2004-10-12 CaS StatusNone Invalid

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code