2011-12-29 4 views
0

중첩 된 alertView를 표시하려고합니다. 내가 중첩 된 alertViews에 직면하는 문제는, 첫 번째 alertView의 "add"버튼을 클릭하면 두 번째 alertView가 표시되고 두 번째 alertView에는 textField와 "Save"버튼이 있습니다. 저장 단추를 클릭 한 다음 첫 번째 alertView에 이미있는 UITableViewData를 다시로드하면 데이터를 저장하고 싶습니다.다른 AlertView로 AlertView를 표시하는 방법

저는 아이폰에 새로운 사람이되었습니다. 제발 도와주세요.

답변

1

다른 tag 속성으로 경고보기를 만들어서 대리자 메서드에서 화면에 나타나는 경고보기를 쉽게 구분할 수 있도록해야합니다.

이제
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Info" 
    message:@"Message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil] autorelease]; 

[alert setTag: 1001]; // give different tag to different alert views 
[alert show]; 
[alert release]; 

위임 방법 : 예를 들어

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
    if (alertView.tag == 1001) 
    { 
     // do something 
    } 
    eles if (alertView.tag == 1002) 
    { 
    } 

} 

가 당신을 도움이되기를 바랍니다 ..

관련 문제