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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]