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

Swift and NSXPCInterface


  • Subject: Swift and NSXPCInterface
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sat, 09 Aug 2014 13:48:20 +0700

I am trying to translate this:
	NSXPCInterface *b =  [NSXPCInterface interfaceWithProtocol:@protocol(Xpc_CommonProtocol)];
to Swift.

This compiles (and runs) as expected:
var dummy : AnyObject?

if let protoDummi = dummy as? Xpc_CommonProtocol
{
	println("dummy DOES implement Xpc_CommonProtocol")
}
else
{
	println("dummy does NOT implement Xpc_CommonProtocol")	//	this does print
}

which seems to prove that Swift knows about by protocol.

But this line:
	let b = NSXPCInterface( protocol: Xpc_CommonProtocol )
creates a lot of errors:
:27: Expected expression in list of expressions
:27: Expected ',' separator
:27: Expected ')' in expression list
:26: Consecutive statements on a line must be separated by ';'
:35: Expected identifier in protocol declaration
:7: Constant 'b' inferred to have type '()', which may be unexpected     <-- Indeed it is!

What do I have to do to get my NSXPCInterface?

Xcode 6 beta 5; 11.9.4

Gerriet.


_______________________________________________

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: Swift and NSXPCInterface
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: NSProgressIndicator (bar) still displays when stopped
  • Next by Date: Does NSPointerArray support zeroing weak references under ARC
  • Previous by thread: Re: unapprehended about block in code
  • Next by thread: Re: Swift and NSXPCInterface
  • Index(es):
    • Date
    • Thread