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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

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

ios - I get the error Property '...' not found on object of type '...' -