Oscar Gomez
Oscar Gomez

Reputation: 18488

Objc - Is @private directive needed anymore in the objective-c language?

I was just wondering if there is any need besides backwards compatibility to keep the @private keyword in objective-c, since class extensions provide a much better way to declare your private iVars. Are there any other reasons for keeping the @private directive?.

Upvotes: 2

Views: 123

Answers (1)

Lily Ballard
Lily Ballard

Reputation: 185681

The 32-bit x86 architecture still requires declaring ivars in the primary @interface block. The ability to synthesize ivars (via properties or class extensions or on the @implementation) is only available for 64-bit x86 and ARM architectures (and, presumably, any future architecture as well).

Upvotes: 1

Related Questions