objective c - iOS: __weak vs (weak) -


are there differences between these 2 lines of code?

__weak iboutlet uitextfield *usernamefield;  @property (weak) iboutlet uitextfield *usernamefield; 

what if declare either of these in interface section of .h or .m files?

yes. first example declares weak instance variable called usernamefield, second declares weak property called usernamefield, , instance variable called _usernamefield accessed property.

if declare in @interface section of .m file, can accessed in .m file (unless mess objective-c runtime).


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -