• 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
IBOutlets and savePanels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IBOutlets and savePanels


  • Subject: IBOutlets and savePanels
  • From: Andrew Merenbach <email@hidden>
  • Date: Sat, 13 Jul 2002 18:20:05 -0700

I have questions on two completely different things. The first is about IBOutlets. In my program, I have a file, Controller.h, which has in it:

IBOutlet NSTextField *textField;

However, in some other sample code, I've seen it also as:

IBOutlet id textField;

Both of the above examples seem to function identically as long as the textField outlet is connected to a text field from within Interface Builder. Is there an advantage to using one over the other?

My second question regards the save panel, which doesn't seem to work when I try to use it as a sheet. I get a warning: "NSSavePanel does not respond to..." when I use the following code, which I carefully based off of an example elsewhere:

NSSavePanel *sp;
int runResult;

/* create or get the shared instance of NSSavePanel */
sp = [NSSavePanel savePanel];

/* set up new attributes */
[sp setRequiredFileType:@"txt"];

/* display the NSSavePanel */
runResult = [sp beginSheetForDirectory:NSHomeDirectory() file:@"X-Quotient Output"]; // modalForWindow:myWindow modalDelegate: nil

/* if successful, save file under designated name */
if (runResult == NSOKButton) {
if (![[quotientText string] writeToFile:[sp filename] atomically:YES])
NSBeep();
}

}

Take care,
Andrew Merenbach
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: IBOutlets and savePanels
      • From: Jeff LaMarche <email@hidden>
  • Prev by Date: Re: Carbon API with carbon
  • Next by Date: runModalForWindow misplaces window
  • Previous by thread: Re: Sheet modal for NSTabViewItem
  • Next by thread: Re: IBOutlets and savePanels
  • Index(es):
    • Date
    • Thread