XCODEのバージョン4.3.2。これは、チュートリアルの実行方法を理解しようとする頭痛の種に終わりはありません。私は彼らのコードに対してコードをチェックしました、そしてそれは正しく見えます。他の人のコピーをダウンロードしましたが、機能しますが、コピーを実行してキャンセルしても機能しません。AddSightingViewController.mコードは次のようになります
#import "AddSightingViewController.h"
@implementation AddSightingViewController
...
- (IBAction)cancel:(id)sender {
[[self delegate] addSightingViewControllerDidCancel:self];
}
- (IBAction)done:(id)sender {
[[self delegate] addSightingViewControllerDidFinish:self name:self.birdNameInput.text location:self.locationInput.text];
}
...
そして、これらの行のデバッグチェックポイントは正しく機能します。ただし、BirdsMasterViewController.mには次のコードがあります。
#import "BirdsMasterViewController.h"
#import "BirdsDetailViewController.h"
#import "BirdSightingDataController.h"
#import "BirdSighting.h"
#import "AddSightingViewController.h"
@interface BirdsMasterViewController () <AddSightingViewControllerDelegate>
@end
@implementation BirdsMasterViewController
@synthesize dataController = _dataController;
...
- (void)addSightingViewControllerDidCancel:(AddSightingViewController *)controller {
[self dismissViewControllerAnimated:YES completion:NULL];
}
- (void)addSightingViewControllerDidFinish:(AddSightingViewController *)controller name:(NSString *)name location:(NSString *)location {
if ([name length] || [location length]) {
[self.dataController addBirdSightingWithName:name location:location];
[[self tableView] reloadData];
}
[self dismissModalViewControllerAnimated:YES];
}
...
これらの行のデバッグチェックポイントは、私のコードでプログラムを停止することはありません(ただし、ダウンロードしたコードでは停止します)。これを機能させるために私は一体何が欠けていますか。