• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Cocoa Document-based Application Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa Document-based Application Question


  • Subject: Cocoa Document-based Application Question
  • From: Josh Morris <email@hidden>
  • Date: Sat, 5 Jan 2002 01:00:58 -0800 (PST)

I recently created a new Cocoa document-based
application in Project Builder, and edited the
contents of the nib file that came with it to suit my
needs.

In the nib's "Window" member, I added an instance of
NSBrowser, then changed its actual type to one I
subclassed in the "Custom Class" tab of the "Show
Info" window.

When I created the files for the subclass of
NSBrowser, everything seemed to be going well, but
through extensive debugging (NSLogs and the
ObjectAlloc program... :)), I have found that when I
run my application my NSBrowser's subclass doesn't
execute its init member function (even though I
overrode it!!). Nevertheless, for each instance of the
document, there is a Browser shown of the type I
subclassed! What's going on?

Here's what I have tried to remedy the situation:
1) Instantiating a KBCEBrowser (my subclass) in
Interface Builder and then cutting and pasting it into
my document window.
2) Removing and adding again the prototype "- (id)
init;" line in my KBCEBrowser.h file (I don't know how
this would help, but I tried it...)

And that's about all I can think of. Am I going to
have to manually create an instance of KBCEBrowser and
attach it to my document window at startup? Can't I do
this using the Interface Builder?

Where did I get this wrong?

All help is appreciated.

-Josh Morris
email@hidden
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


  • Follow-Ups:
    • Re: Cocoa Document-based Application Question
      • From: "Erik M. Buck" <email@hidden>
    • Re: Cocoa Document-based Application Question
      • From: Ryan Dingman <email@hidden>
  • Prev by Date: Re: arrow, arrow-plus, and arrow-arrow TIFFs
  • Next by Date: Which Dock item chosen?
  • Previous by thread: Re: arrow, arrow-plus, and arrow-arrow TIFFs
  • Next by thread: Re: Cocoa Document-based Application Question
  • Index(es):
    • Date
    • Thread