• 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
Re: Open Recent menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Recent menu


  • Subject: Re: Open Recent menu
  • From: Glenn Andreas <email@hidden>
  • Date: Tue, 20 Jul 2004 08:54:29 -0500

At 12:18 AM -0400 7/20/04, Sam Wilkins wrote:

Oh my God, I figured it out.
- (BOOL)application:(NSApplication *) openFile:(NSString *)filename
Was what I called my method, I can't believe I went through all of this just to notice I was missing the argument name after the NSApplication
* argument. WTF did it compile?

-(BOOL)application::

(instead of -(BOOL)application:openFile:)

Note that in a selector, the identifier before the colon can be blank (but since the parameter identifier is required, it "stole" the signature name in your case). It is rarely approrpriate style to be like like that, though. Unlike C function declarations, you thus can't skip the name of your parameter:

foo(int, int y)

would be a C function that has two int parameters, the first of which is ignored in the function (this sort of thing can be done to silence "unused parameter" warnings). There is no equivalent Objective-C "my function will ignore this parameter so I'm not even going to bother to give it a name".

--
Glenn Andreas email@hidden mondo blobbo, Cythera, Theldrow, oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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.


References: 
 >Re: Open Recent menu (From: Sam Wilkins <email@hidden>)
 >Re: Open Recent menu (From: m <email@hidden>)
 >Re: Open Recent menu (From: Sam Wilkins <email@hidden>)

  • Prev by Date: printing a table
  • Next by Date: Re: Links in NSTextView
  • Previous by thread: Re: Open Recent menu
  • Next by thread: Pref Pane building questons
  • Index(es):
    • Date
    • Thread