これまでに遭遇したことのない奇妙な問題があります。viewControllerにUIViewに表示したいデータがあります。
これはSplitViewControllerを含むiPadアプリであり、テーブルビュー(masterView)内の要素をクリックすると、(プロトコルを介して)detailViewControllerで関数が実行されます。
UIViewを起動してデータを送信する関数が実行されます。
myController:
- (void)SelectionChanged:(DocumentInfo*)document_info withDocu:(Document *)document{
DocumentView *viewDoc=[[DocumentView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
viewDoc.doc=document;
viewDoc.doc_info=document_info;
[viewDoc setBackgroundColor:[UIColor whiteColor]];
[self.view addSubview:viewDoc];
}
DocumentView.h
#import <UIKit/UIKit.h>
#import "Document.h"
#import "DocumentInfo.h"
@class Document;
@class DocumentInfo;
@interface DocumentView : UIView
@property(strong,nonatomic) Document *doc;
@property(strong,nonatomic) DocumentInfo *doc_info;
@end
DocumentView.m
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UILabel *titreDoc=[[UILabel alloc] initWithFrame:CGRectMake(20, 32, 339, 21)];
titreDoc.textColor = [self makeColorRGB_RED:66 GREEN:101 BLUE:149];
titreDoc.font = [UIFont fontWithName:@"System" size:(24.0)];
[self addSubview:titreDoc];
NSLog(@"%@ - %@",doc,doc_info);
titreDoc.text=@"Nouveau Document";
}
return self;
}
私のビューはうまく表示されています(つまり、ラベルが表示されています)が、渡されたはずのデータを取得できません...(NSLog print(null)(null))
誰もがその理由を知っていますか?