iphone - myView.frame Vs. self.myView.frame -
iphone - myView.frame Vs. self.myView.frame -
i know it's advisable utilize @property
accessors, , know it's of import utilize self.myview = x
instead of mview = x
, but:
isn't myview.frame
sufficient? atomicelementflippedview.m file in theelements has self.wikipediabutton.frame=buttonframe;
. shouldn't leave out self
if i'm getting/setting property of ivar , not ivar itself?
it [self.wikipediabutton addtarget:...];
. shouldn't leave out self
here well? shouldn't phone call function on ivar, not property? i.e., [wikipediabutton addtarget:...];
thanks!
matt
both work.
the main reason using getters within class code changes easy. if decide store info in different fashion or build dynamically on request, there single point of change. views it's not of import most of time, can come handy when replace view finish view hierarchy (your original view beingness maybe part of it).
iphone objective-c properties
Comments
Post a Comment