私はO'Reillyの本LearningCocoawith Objective-C3rdeditionを読んでいます。
O'ReillyのWebサイトには、この特定の本のフォーラムがなく、このエラーを検索しても何も返されません。
18ページで、次のエラーが発生し続けます。
"No visible @interface for 'UIAlertView' declares the selector 'initWithTitle:message:deluge:cancelButtonTitle:otherButton'"
これが私のコードです:
//
// ViewController.m
// HelloCocoa
//
// Created by ME on 1/14/13.
// Copyright (c) 2013 ME. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)showAlert:(id)sender
{
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Hello!"
message:@"Hello, World!"
delegate:nil
cancelButtonTitle:@"Close"
otherButtonTitle:nil];
[alert show];
[_helloButton setTitle:@"I was Clicked!" forState:UIControlStateNormal];
}
@end
//
// ViewController.h
// HelloCocoa
//
// Created by ME on 1/14/13.
// Copyright (c) 2013 Andrew DiNatale. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIView *helloButton;
- (IBAction)showAlert:(id)sender;
@end
このエラーの原因は何ですか?