• 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
(hopefully!) simple newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(hopefully!) simple newbie question


  • Subject: (hopefully!) simple newbie question
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 11 Jan 2006 16:22:27 +0000

I am sure the answer to this is very simple, but I can't seem to find anything in my Cocoa book, so here goes:

I have subclassed NSDocumentController in my app so that I can decide whether or not to open a new document. If it is appropriate to open a new Doc, my subclass of openUntitledDocumentOfType: display: does the following:

return [super openUntitledDocumentOfType: docType display: YES];

However, I now need to call a particular method of the NSDocument that this code returns, but I don't know how to "store" that document. Basically I want to be able to do something like this:

newDoc = [super openUntitledDocumentOfType: docType display: YES];
[newDoc myMethod];
return newDoc;

So how do I actually do this? What I've written doesn't compile because I haven'tdeclared newDoc. I tried doing:

id *newDoc

but this didn't work.  Anyone?

Mike Abdullah.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • NSDocument Ignoring Advisory Locks?
      • From: KJ Walker <email@hidden>
    • Re: (hopefully!) simple newbie question
      • From: Andy Armstrong <email@hidden>
  • Prev by Date: Re: Cocoa control in carbon window
  • Next by Date: Re: (hopefully!) simple newbie question
  • Previous by thread: Problems inserting into an ArrayController
  • Next by thread: Re: (hopefully!) simple newbie question
  • Index(es):
    • Date
    • Thread