Thread with 16 posts

jump to expanded post

“why don't languages like c++ and java have multiple constructors? they're so useful! i love that rust has multiple constructors!”

the finger curls on the monkey's paw

and i find out about the hell of objective-c designated initialisers

Open thread at this post
✾, chief troublemaker , @millenomi@lily.network
(open profile)

@saagar @jrose @porglezomp @hikari yup, correct. It means that you are inheriting your designated initializer situation from your superclass, that is, you support using your superclass’s initializers to produce a fully functional object of _your_ subclass, and so the init(coder:) of your superclass is good enough for your subclass too.

The moment you add a designated init, the init(coder:) of your superclass isn’t sufficient anymore and you have to do both (if only to fatalErrror out).

Open remote post (opens in a new window)