> On Feb 19, 2015, at 9:37 AM, Gordon Apple <[email protected]> wrote: > > You can define optional methods in a protocol. You can also define > properties. However, the latter will not get synthesized in the adopter. You > have to add the accessors and ivars yourself. (One of my gripes with > protocols. They could fix this if they wanted to.)
We don't want to. Automatically synthesizing properties when you merely declared conformance to a protocol caused bugs. One example: Your superclass implements a property. You inherit that implementation and declare conformance to a protocol that requires that property. Automatic synthesis of the protocol's property would override the superclass implementation and break stuff. -- Greg Parker [email protected] <mailto:[email protected]> Runtime Wrangler
_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com This email sent to [email protected]
