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
Post a Comment