UITableview (CompleteView) から選択した 2 つの文字列を新しい UIView (DetailView) に渡したい これは私のコードです:
CompleteView.h() で
@property (nonatomic, retain) NSString *memoString;
@property (nonatomic, retain) NSString *previewString;
Completeview.m() 内
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
previewString = [PreviewArray objectAtIndex:indexPath.row];
NSLog(@"Preview string %@",previewString);
memoString = [MemoArray objectAtIndex:indexPath.row];
NSLog(@"Memo string %@",memoString);
DetailView *detailAlert = [[DetailView alloc] initWithFrame:CGRectMake(10, 40, 300, 300)];
detailAlert.strPreview =previewString ;
detailAlert.strMemo = memoString;
[self.view addSubview:detailAlert];
[detailAlert show];
[detailAlert release];
}
DetailView() で
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
originalFrame = frame;
UIWebView *videoview = [[UIWebView alloc] initWithFrame:CGRectMake(10,80,275.0,150)];
NSString *url=[NSURL URLWithString:strPreview];
NSURL *nsurl=[NSURL URLWithString:url];
NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
[videoview loadRequest:nsrequest];
[self addSubview:videoview];
return self;
}
DetailView.h 内
@property (nonatomic, retain) NSString* strMemo;
@property (nonatomic, retain) NSString* strPreview;
実行すると、previewString は DetailView に送信されません。strPreview を実行し、DetailView の strMemo が 0x00000 の場合、デバッグ中です。前もって感謝します