2010-08-10 145 views
0

我是新來的iPhone。運行我的應用程序後,如果我點擊一個菜單按鈕,我希望它顯示關於或幫助,就像一條警告消息。如果他們選擇關於它將打開一個網頁。當選擇幫助時,它將顯示一些文本。如何添加自定義消息框

回答

1
UIAlertView *slpp=[[UIAlertView alloc] initWithTitle:@"Wrong!" message:@" your message" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 
2

編寫代碼將UIAlertView添加到您的菜單按鈕中單擊並實施UIAlertView的代理方法。

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
    // write your code here 
} 
相關問題