Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8277143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:36:05+00:00 2026-06-08T08:36:05+00:00

I recently started an Xcode project, and its mostly web-based, in the sense it

  • 0

I recently started an Xcode project, and its mostly web-based, in the sense it mostly works with UIWebView. I am a total noob at this. I would like to make an “No Internet Connection Alert”. Basically An Alert that comes up if you have no internet connection. I have tried using the Reachability but since I’m such a noob, I didn’t manage to figure ANYTHING out.. Heres my view controller:
This is my .h file: P.S: My WebView is called ‘webone’.

#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController

-(IBAction)refreshClicks:(id)sender;

@property (weak, nonatomic) IBOutlet UIWebView *webone;
@end

And This is My .m file:

#import "FirstViewController.h"
@interface FirstViewController ()

@end

@implementation FirstViewController
@synthesize webone;


-(void)viewDidLoad {
    NSURL *url = [NSURL URLWithString:@"http://www.lostcraft.net/mobile"]; 
    NSURLRequest *req = [NSURLRequest requestWithURL:url]; 
    [webone loadRequest:req];    
    [super viewDidLoad];
}

-(void)awakeFromNib{  //IGNORE
    [self refreshClicks:self]; //IGNORE
}

-(IBAction)refreshClicks:(id)sender{//IGNORE
    [webone loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.lostcraft.net/mobile"]]];//IGNORE
}

- (void)viewDidUnload
{
    [self setWebone:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:36:06+00:00Added an answer on June 8, 2026 at 8:36 am

    Place this in your .m file

    Under Your IBAction:

    NSString *web = @"http://YOUR WEB ADRESS HERE";
                     NSURL *url = [NSURL URLWithString:web];
    NSURLRequest *requestUrl = [NSURLRequest requestWithURL:url];
    [webdone loadRequest:requestUrl];
    

    Then somewhere in your .m

    -(void)webView:(UIWebView *)webdone didFailLoadWithError:(NSError *)error {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Please check     your internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    
    }  
    

    go into connections tab in interface builder in xcode

    enter image description here

    Right click from the delegate as shown in the picture (the top option) and drag it to your view contoller where you have your web view (webdone)

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently upgraded to Xcode 4.2 and its started to give me so
I recently started a new project in Xcode 4.4 running on Mountain Lion. I
Ive recently started migrating a project to MagicalRecord and cant find how i would
I recently started using Xcode 4.2 and the iOS 5 simulator. When I update
Greetings. I've been using vim for years, and I've recently started toying with XCode.
I recently started working with a client that had an index.html file with this
I recently started learning backbone and was wondering what would be the best way
I recently started a project in Symfony2 and I need to run some methods
I´ve recently started looking a web service calls using PHP. I can´t get the
I recently started using Xcode for developing. It's pretty neat. By accident I happened

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.