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

why is this Swift initializer legal


  • Subject: why is this Swift initializer legal
  • From: Roland King <email@hidden>
  • Date: Sat, 06 Jun 2015 17:43:19 +0800

public class RDKBLEService : NSObject
{
	let peripheral : CBPeripheral

	public init( peripheral: CBPeripheral )
	{
		self.peripheral = peripheral
	}
}

It’s a designated initialiser, there’s a superclass (NSObject) but the initialiser doesn’t call a designated initialiser of the superclass. According to the rules I was just re-re-re-reading about Swift initialisation, it’s required to call a superclass designated initialiser from your derived class. I was looking to see if I could find an exception to the rule which this fell under but can’t.
_______________________________________________

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: Greg Parker <email@hidden>
    • Re: why is this Swift initializer legal
      • From: Quincey Morris <email@hidden>
    • Re: why is this Swift initializer legal
      • From: Marco S Hyman <email@hidden>
  • Prev by Date: Re: Using CFSTR() with const char * variable
  • Next by Date: Re: why is this Swift initializer legal
  • Previous by thread: Re: Using CFSTR() with const char * variable
  • Next by thread: Re: why is this Swift initializer legal
  • Index(es):
    • Date
    • Thread