Hi, I tried to understand the three20 ttnavigator example code, and in the MenuController.h file, it is as follows:
typedef enum {
MenuPageNone,
MenuPageBreakfast,
MenuPageLunch,
MenuPageDinner,
MenuPageDessert,
MenuPageAbout,
} MenuPage;
@interface MenuController : TTTableViewController {
MenuPage _page;
}
@property(nonatomic) MenuPage page;
@end
I don't understand why there is a MenuPage _page declared as an instance variable, while there is another variable MenuPage page declared in the @property section. In the MenuController.m file, MenuPage page is synthesized, not _page.
Is this legal?
I know it works, because it compiles, but I don't understand why we don't need to set an @property (nonatomic, retain) MenuPage _page
or declare MenuPage page
in the interface.
Thanks!