0

I am creating an ios application in objective-c with xcode and came across a strange error. the code is:

#import "LAAppDelegate.h"
#import "Reachability.h"

@implementation LAAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:    (NSDictionary *)launchOptions
{
    NetworkStatus networkStatus =
        [[Reachability reachabilityForInternetConnection]
         currentReachabilityStatus];
    if (networkStatus == NotReachable) {
        UIAlertView *alert = [[UIAlertView alloc]
        initWithTite:@"Network Unavailable"
        message:@"Lazuli requires an internet connection"
        delegate:nil
        cancelButtonTitle:@"Ignore"
        otherButtonTitles:nil];
    [alert show];

    }

   // Override point for customization after application launch.
   return YES;
}

I keep getting the error: "No visible @interface for 'UIAlertView' declares the selector 'initWithTite:message:delegate:cancelButtonTitle:otherButtonTitles:' "

I am a beginner and need help!

Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
RoyaltyInCode
  • 11
  • 1
  • 4
  • 1
    you has to change initWithTite for initWithTitle, you miss the 'l' – tkanzakic Jan 01 '13 at 15:47
  • 1
    As an aside, calling Reachability that way is wrong in two ways. You should attempt a connection using NSURLConnection since the radio on the device might be powered down and NSURLConnection will power it up. Reachability will not. Also, if the network is up but not working well, your app will lock up and be terminated. Never make a synchronous network call on the main thread and that includes Reachability. – EricS Jan 01 '13 at 16:27

1 Answers1

5

You have a typo in your method call. It's initWithTitle..., not initWithTite...

DrummerB
  • 39,814
  • 12
  • 105
  • 142