Re: why is this Swift initializer legal
Re: why is this Swift initializer legal
- Subject: Re: why is this Swift initializer legal
- From: Marco S Hyman <email@hidden>
- Date: Sat, 06 Jun 2015 11:18:27 -0700
> public class RDKBLEService : NSObject
> {
> let peripheral : CBPeripheral
>
> public init( peripheral: CBPeripheral )
> {
> self.peripheral = peripheral
> }
> }
Swift doesn’t think init in NSObject is a designated initializer. Add
“override” as you would with a designated initializer and you get an error
stating “does not override a designated initializer from its superclass”.
I do not know why.
Marc
_______________________________________________
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