getters and setters

- (id)foo {

  return foo;

}

 

- (void)setFoo:(id)aFoo {

  if(aFoo != foo) {

    [aFoo retain];

    [foo release];

    foo = aFoo;

  }

}

@property

@synthesize    in the implementation file

Button_FunViewController.m

we will tell the compiler to create the getter and setter methods at compile time.

  

posted @ 2012-09-16 11:53  顺武  阅读(315)  评论(0编辑  收藏  举报