Advertisement
Guest User

Untitled

a guest
May 30th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. @interface School : NSObject
  2.  
  3. @property NSInteger level;
  4.  
  5. - (BOOL) isForKids;
  6.  
  7. @end
  8.  
  9. @implementation School
  10. - (BOOL) isForKids {
  11. return _level == 3;
  12. }
  13.  
  14. @end
  15.  
  16. School *mySchool = [[School alloc] init];
  17. //set level to 3
  18. mySchool.level = 3;
  19. // expected boolean true but get false, why?
  20. BOOL forKids = [mySchool isForKids];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement