ARC语义问题目标-c

时间:2013-01-01 15:30:54

标签: objective-c xcode

我正在使用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:'”

我是初学者,需要帮助!

1 个答案:

答案 0 :(得分:5)

您的方法调用中有拼写错误。它是initWith 标题 ...,而不是initWith Tite ......