http://www.raywenderlich.com/14172/how-to-parse-html-on-iosのチュートリアルに従っています。
これが私の detailviewcontroller.h ファイルです。
#import <UIKit/UIKit.h>
@end <-- //errors shows up here.
@interface DetailViewController : UIViewController
@property (strong, nonatomic) id detailItem;
@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
@end
これは私のdetailview.mファイルです
#import "DetailViewController.h"
@interface DetailViewController ()
- (void)configureView;
@end
@implementation DetailViewController
#pragma mark - Managing the detail item
- (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem) {
_detailItem = newDetailItem;
// Update the view.
[self configureView];
}
}
- (void)configureView
{
// Update the user interface for the detail item.
if (self.detailItem) {
self.detailDescriptionLabel.text = [self.detailItem description];
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self configureView];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"Detail", @"Detail");
}
return self;
}
@end
上で言及したように、@end エラー メッセージが表示され、赤い四角で自動修正を待ちます。自動修正を行うことに同意します。次に、.h ファイルに示されているように、xCode はそこに @end コードを適用します。次に、タイトルにあるように、「 @end must appear in an object-c context 」という別のエラーが表示されます
私は何をすべきか ?xCodeが狂ってしまったのか、それとも何なのか.
どうしたの ?