xcode - iOS SDK - Correct methodology in making connections with an outlet? -


i know if use

@interface tpn : uiviewcontroller{      iboutlet uiview *testview; }  @property (strong, nonatomic) iboutlet uiview *testview; 

i know first 1 private variable accessed within class. , second 1 "@property" able accessed instantiated object. find odd in tutorials people tend set properties when changing outlet within class itself. there guideline should following?

you no longer need specify ivar @ all. nor there need use @synthesize.

use property, make sure weak, not strong

@interface tpn : uiviewcontroller  @property (weak, nonatomic) iboutlet uiview *testview;   

in implementation can access ivar _testview.

for private property (above public) instead put @property within category in implementation file:

#import "tpn.h" @interface tpn ()  @property (weak, nonatomic) iboutlet uiview *testview;     @end  @implementation tpn .... 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -