クラス転送を使用して、循環依存の問題を解決しました。現在、「showSumDetails」メソッドが見つからないという警告が表示されます。なぜそれが起こるべきなのか全く分かりません、どんな助けでもありがたいです。ここに少しのコードを含めます:
MyAnnotation.h
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
//#import "MyMapViewController.h" obviously this wasn't possible :-(
@class MyMapViewController;
@interface MyAnnotation : NSObject<MKAnnotation> {
MyMapViewController* mapController;
}
MyMapViewController.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <MapKit/MKReverseGeocoder.h>
#import "MyAnnotation.h"
@interface MyMapViewController : UIViewController <MKMapViewDelegate>{
MyAnnotation *annot;
}
MyMapViewController.m-メソッドが実際に存在し、ヘッダーファイルでも定義されている場所。
@implementation MyMapViewController
@synthesize annot;
-(void) showSumDetails:(id)aSumData{
NSLog(@"mapViewController-showSumDetails");
SumDetailsViewController *wrController = [[SumDetailsViewController alloc] init];
wrController.sumData = aSumData;
[self.navigationController pushViewController:wrController animated:YES];//This needs to be pushed
[wrController release];
}
@end
しかし、MyAnnotation.mの次のメソッドは、上記のメソッドを見つけることができません:-(
@implementation MyAnnotation
@synthesize sumData;
@synthesize mapController;
- (void) showPD{//is also defined in header file
NSLog(@"sPD - MyAnn");
[mapController showSumDetails:sumData]; //This doesn't have a clue about showSumDetails method- Why??
}
これ以上の情報を提供させていただきます。助けてください!!!