• 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: why is this Swift initializer legal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: why is this Swift initializer legal
      • From: Roland King <email@hidden>
References: 
 >why is this Swift initializer legal (From: Roland King <email@hidden>)

  • Prev by Date: why is this Swift initializer legal
  • Next by Date: Re: why is this Swift initializer legal
  • Previous by thread: why is this Swift initializer legal
  • Next by thread: Re: why is this Swift initializer legal
  • Index(es):
    • Date
    • Thread