William Sham
William Sham

Reputation: 13239

Is declaration of variable necessary in objective-c

In the following code:

       @interface UnitConverterViewController : UIViewController {
          UITextField     *tempText;
       }
       @property (strong, nonatomic) IBOutlet UILabel *resultLabel;
       @end

I've seen the same result achieved with out having

       {
          UITextField     *tempText;
       }

So, is this really necessary?

Upvotes: 1

Views: 154

Answers (1)

SundayMonday
SundayMonday

Reputation: 19727

No it's not necessary as of Objective-c 2.0.

see: Do declared properties require a corresponding instance variable?

Upvotes: 4

Related Questions