Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIAlertView from选项卡按钮-无Internet连接_Iphone_Objective C_Xcode_Cocoa_Xcode4.3 - Fatal编程技术网

Iphone UIAlertView from选项卡按钮-无Internet连接

Iphone UIAlertView from选项卡按钮-无Internet连接,iphone,objective-c,xcode,cocoa,xcode4.3,Iphone,Objective C,Xcode,Cocoa,Xcode4.3,再次寻求帮助 我的应用程序目前有两个部分需要连接互联网,一个是通过Flickr的照片库,另一个是Twitter提要,我想知道这是否是UIAlertView的正确代码。。。我可以通过按钮让它工作,但仅此而已 { -(void)didTap_roundedRectButton1:(id)sender forEvent:(UIEvent *)event { UIAlertView *alertView = [[UIAlertView alloc] init]; alertView.title = @"

再次寻求帮助

我的应用程序目前有两个部分需要连接互联网,一个是通过Flickr的照片库,另一个是Twitter提要,我想知道这是否是UIAlertView的正确代码。。。我可以通过按钮让它工作,但仅此而已

{
-(void)didTap_roundedRectButton1:(id)sender forEvent:(UIEvent *)event {
UIAlertView *alertView = [[UIAlertView alloc] init];
alertView.title = @"You are not connected to the Internet!";
alertView.message = @"Please check your connection and try again...";
[alertView addButtonWithTitle:@"Ok"];
[alertView show];
[alertView release];
} 
你应该试试这个:

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"You are not connected to the Internet!" 
                                                  message:@"Please check your connection and try again..."
                                                 delegate:nil 
                                        cancelButtonTitle:@"OK" 
                                        otherButtonTitles: nil];

  [alertView show];
  [alertView release];

你能发布代码吗?你是如何创建UIButton的?

我想你需要使用这个例子,因为我用它来检查是否有任何网络可用,设备是否连接到苹果开发者示例网站上的任何一个网络
示例链接是

还请记住,如果由于设备处于飞行模式等原因导致连接中断,而您的应用程序试图访问网络资源,iOS将为您发布警报。在这种情况下,您可能不需要另外提醒用户。对不起,我认为我的问题是错误的!我几乎完成了我的应用程序,但在提交时遗漏了苹果要求的“无互联网连接”错误。如果我在没有互联网的情况下点击应用程序中的“照片库”,它会使应用程序崩溃,不知道为什么?我想我需要一个UIAlertView来检查连接?任何帮助都是很好的…坏链接-以下是tonymillion在GitHub上的可访问性: