Re: NS_DESIGNATED_INITIALIZER expected : (colon)
Re: NS_DESIGNATED_INITIALIZER expected : (colon)
- Subject: Re: NS_DESIGNATED_INITIALIZER expected : (colon)
- From: Michael Babin <email@hidden>
- Date: Mon, 09 Jun 2014 07:28:48 -0500
On Jun 9, 2014, at 7:03 AM, Devarshi Kulshreshtha <email@hidden> wrote:
> I am trying to declare a designated initializer like this:
>
> - (instancetype)initWithDelegate:(id <MyDelegate>)delegate
> NS_DESIGNATED_INITIALIZER;
>
> But it is showing me this compilation error:
>
> Expected ':'
>
> Interestingly when I try to write it like this (reference link:
> https://developer.apple.com/library/prerelease/ios/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObjective-C/AdoptingModernObjective-C.html)
> -
>
> - (instancetype)init NS_DESIGNATED_INITIALIZER;
>
> It shows this error:
>
> Expected ';' after method prototype.
>
> Any ideas on how to properly use NS_DESIGNATED_INITIALIZER?
The usage in the declaration you provided looks correct. What does it look like when you preprocess the .m file (Product > Perform Action > Preprocess)?
_______________________________________________
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