2010년 8월 26일 목요일

[iOS] Navigation bar button - 네비게이션바에 좌/우 버튼 박기

너무 자주 까먹는다. 대충 코드만 남기자. 이 코드는 네비에이션 컨트롤에서 루트 콘트롤로 붙여진 뷰 컨트롤러에 삽입된 코드이다.

UIBarButtonItem *rightButton = [[UIBarButtonItem alloc]
  initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
                       target:self
                       action:@selector(RightButtonPushed)];

[self.navigationItem setRightBarButtonItem:rightButton];
대충 알아서 처리되겠지 뭐.

댓글 없음 :