2011년 6월 18일 토요일

[Object C] 여러 alertView 구분 법

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if ([alertView tag] == 111) {
// 눌러진 버튼의 기본 INDEX 0입니다.
printf("User Pressed Button %d\n", buttonIndex + 1);
}
[alertView release];
}

- (void) showAlert {

UIAlertView * winAlert = [[UIAlertView alloc
                                  initWithTitle:@"알림"
                                  message:@"메시지 내용이 출력됩니다."
                                  cancelButtonTitle:nil
                                  otherButtonTitles:@"하나"@""nil];
// 태그 지정으로 알림창 닫힏때 어떤 알림창이 닫혔는지 인식함
[winAlert setTag:111];

[winAlert show];
[winAlert release];
}

댓글 없음:

댓글 쓰기