• 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: Terminate app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminate app


  • Subject: Re: Terminate app
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 13 Jul 2015 16:48:41 +0000

On Jul 13, 2015, at 09:25 , Jan E. Schotsman <email@hidden> wrote:
>
> NSApplication.terminate(self)  // ! Cannot invoke 'terminate' with an argument list of type '(AppDelegate)'

You’re mistakenly invoking the method on the class, not on the application instance. Try:

	NSApplication.sharedApplication.terminate(self)

Note that in Swift, you can write SomeClass.instanceMethod (instanceOfSomeClass, …) as an equivalent of instanceOfSomeClass.instanceMethod (…), and the error message you got is helpfully trying to show you how to do that. :)



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Terminate app
      • From: Charles Srstka <email@hidden>
    • Re: Terminate app
      • From: Quincey Morris <email@hidden>
References: 
 >Terminate app (From: "Jan E. Schotsman" <email@hidden>)

  • Prev by Date: Terminate app
  • Next by Date: Re: Terminate app
  • Previous by thread: Terminate app
  • Next by thread: Re: Terminate app
  • Index(es):
    • Date
    • Thread