ios - Why does self.SwipeDirection work if the property is called swipeDirection? -


i have simple viewcontroller derived uiviewcontroller have added enum property swipedirection. in code refer self.swipedirection in 1 instance notice have mistakenly typed self.swipedirection.

if jump definition right variable , code compiles , runs correctly sure correct variable being used.

.h file

enum escrolldirection {     e_scroll_direction_none = 0,     e_scroll_direction_left,     e_scroll_direction_right,     e_scroll_direction_up,     e_scroll_direction_down }; typedef enum escrolldirection escrolldirection; @interface processingviewcontroller : uiviewcontroller <uiscrollviewdelegate> @property(nonatomic, assign)escrolldirection swipedirection; @end 

.m file

- (void)scrollviewdidscroll:(uiscrollview *)sender {     cgpoint offset = self.graphscrollview.contentoffset;     self.swipedirection = [self getscrolldirection:self.previoustouchpoint endpoint:self.graphscrollview.contentoffset]; // ... } 

in theory properties compiled setter method call following rule default - setter name property setproperty: (note 1st letter of property name becoming uppercase). both following lines of code

self.swipedirection = ... self.swipedirection = ... 

are compiled existing setter method

[self.setswipedirection:...] 

and equivalent compiler point of view.

note - same not work (default) getter method , following line not compile:

nslog(@"%d", self.swipedirection); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -