我是新iphone development.I正在创建一个地图application.Now我面临的问题与警报view.To看到警报视图中显示的模拟器,我添加了一个警报视图中的“视图做负载” method.When我在登陆页面点击一个按钮,它导航到另一个视图(其中显示警报视图)当我运行应用程序,在控制台窗口中,我可以看到会话的着陆页的初始启动之后再次启动。

用于显示所述警报

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

在控制台窗口

  [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帮助我的任何行动。请引导me.Thanks。

有帮助吗?

解决方案

这仅仅是调试器(GDB)初始化。

如果调试未启动的应用程序启动(这会是这样的,如果你只是建立和运行,而不是构建和调试)调试程序将启动,并在应用程序遇到问题初始化。

您这里的问题是在你的警报视图的init线。一切都很好,直到最后一个参数:otherButtonTitles: - 注意在标题,不是所有权复数。这意味着参数接受物品的零封端的列表 - 这也是本文档中所述

您应该修改你的代码,这样的参数是零终止,像这样:

 UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Current Location" message:@"Show Current Location?" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top