0

我正在使用 xcode 在 Objective-c 中创建一个 ios 应用程序,但遇到了一个奇怪的错误。代码是:

#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;
}

我不断收到错误消息:“'UIAlertView' 没有可见的@interface 声明选择器'initWithTite:message:delegate:cancelButtonTitle:otherButtonTitles:'”

我是初学者,需要帮助!

4

1 回答 1

5

您的方法调用中有错字。它是 initWith Title ...,而不是 initWith Tite ...

于 2013-01-01T15:33:05.097 回答