You can pass custom Initialisers like below . If you wish you can add one parameter to custom Initialisers
In CompleteView.h()
@property (nonatomic, retain) NSString *memoString;
@property (nonatomic, retain) NSString *previewString;
In 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) andPreviewstring:previewString];
detailAlert.strPreview =previewString ;
detailAlert.strMemo = memoString;
[self.view addSubview:detailAlert];
[detailAlert show];
[detailAlert release];
}
In DetailView()
- (id)initWithFrame:(CGRect)frame andPreviewstring:(NSString *)stPreview
{
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;
}
In DetailView.h
@property (nonatomic, retain) NSString* strMemo;
@property (nonatomic, retain) NSString* strPreview;
- (id)initWithFrame:(CGRect)frame andPreviewstring:(NSString *)stPreview;