私はinitメソッド内デリゲートを設定CLLocationManagerとチュートリアルの作業:セットデリゲート(二つの異なる方法、それらが等しい?)
デリゲートを設定し- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager startUpdatingLocation];
}
return self;
}
:
[locationManager setDelegate:self];
を
別のチュートリアルでは、デリゲートをヘッダファイルに設定しました。
@interface MyViewController : UIViewController <CLLocationManagerDelegate>
これらは同じですか?違いがあれば(もしあれば)?
あなたの偉大な答えをお寄せいただきありがとうございます。 –