UIAlertView와 비슷하다
- (IBAction)captureClicked:(id)sender{
UIActionSheet *ask = [[UIActionSheet alloc] initWithTitle:@"사진" delegate:self cancelButtonTitle:@"취소" destructiveButtonTitle:@"앨범에서 선택" otherButtonTitles:@"찍기",nil];
//other버튼에서 마지막에 nil로 하는거 잊지말자 가끔씩 깜빡하는데 콘솔봐도 에러메세지 안뜨고 삽질하기 쉽다.
ask.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[ask showInView:self.view];
[ask release];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch(buttonIndex)
{
case 0:
[self getPhotos];
break;
case 1:
break;
}
}
삽질하지말고 액션시트 델리게이트정도는 추가하자
'Objective-C' 카테고리의 다른 글
[iPhone] UIPickerView 써먹기 (0) | 2010.10.30 |
---|---|
[iPhone] PHP연동시 한글 파라미터 넘기기 (0) | 2010.10.19 |
[iPhone] 사진앨범 또는 카메라 사용해서 이미지 가져오기 (0) | 2010.10.11 |
[iPhone] 애니메이션 및 페이드아웃 효과 (0) | 2010.10.07 |
[iPhone] UITextView 폰트, 사이즈 설정 (0) | 2010.10.07 |