2010-02-18 63 views
0

我是新iphone development.I正在創建一個地圖application.Now我面臨的問題與警報view.To看到警報視圖中顯示的模擬器,我已經添加在一個警報視圖「視圖做負載」方法。當我在登陸頁面點擊一個按鈕,它導航到另一個視圖(其中顯示警報視圖)當我運行應用程序,在控制檯窗口中,我可以看到會話的着陸頁的初始啓動之後再次啓動。在iPhone中使用警報視圖時會話重新啓動?

在控制檯窗口

[Session started at 2010-02-18 15:57:12 +0530.] 

[Session started at 2010-02-18 15:57:23 +0530.] 
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009) 
Copyright 2004 Free Software Foundation, Inc. 
GDB is free software, covered by the GNU General Public License, and you are 
welcome to change it and/or distribute copies of it under certain conditions. 
Type "show copying" to see the conditions. 
There is absolutely no warranty for GDB. Type "show warranty" for details. 
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all 
Attaching to process 604. 
(gdb) 

我只是想看看警報視圖沒有做上點擊確定或取消buttons.Please幫助我的任何行動顯示警報

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Current Location" message:@"Show Current Location?" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK"]; 
    [alert show]; 

。請指導我。謝謝。

回答

1

這只是調試器(GDB)初始化。

如果調試未啓動的應用程序啓動(這會是這樣的,如果你只是建立和運行,而不是構建和調試)調試程序將啓動,並在應用程序遇到問題初始化。

你有這裏的問題是在你的警報視圖的init線。一切都很好,直到最後一個參數:otherButtonTitles: - 注意標題上的複數,而不是標題。這意味着參數採用無終止項目列表 - 這也在文檔中說明。

你應該修改你的代碼,這樣的參數是零終止,像這樣:

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Current Location" message:@"Show Current Location?" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; 
+0

Thanks.It正在fine.Where應該怎麼寫,點擊「OK」事件,應該加載當前位置的代碼 – Warrior 2010-02-18 12:15:17

+1

這是一個單獨的主題,所以你應該爲此提出一個新問題。 甲提示是看'UIAlertViewDelegate'協議。 – Jasarien 2010-02-18 13:46:00

相關問題