I have created two views (mainView & detailView) in IB.... and have added the detailView as subview to mainView....
Now when i want to add subviews to detailView it is not allowing to do so..& gives a build error..
Also when i am creating custom class UIView, same error is given..
Plz suggest how to add subView to existing subview
Now when i want to add subviews to detailView it is not allowing to do so..& gives a build error..
Code:
@synthesize detailView;
- (void)viewDidLoad {
[super viewDidLoad];
//detailView = [[UIView alloc] init];
detailView.frame = CGRectMake(230, 140, 538, 820);
[self.view addSubview:detailView];
}
-(void)createsubview{
slideUpView = [[UIView alloc] initWithFrame:frame];
[COLOR="DarkOrange"] [[detail view] addSubview:slideUpView]; [/COLOR] //----warning : UIView may not respond to '-view'
//following works fine
//[[self.view] addSubview:slideUpView];
}
Also when i am creating custom class UIView, same error is given..
Code:
@interface ThumbDetailView : UIView{
....
....
}
@implementation ThumbDetailView
-(id)initWithFrame:(CGRect)_frame{
self=[super initWithFrame:_frame];
if (self) {
[self setUserInteractionEnabled:YES];
[self setExclusiveTouch:YES];
}
return self;
}
-(void)createView:(NSString *)_prodCode{
[COLOR="DarkOrange"]CGRect bounds = [[self view] bounds]; [/COLOR] // warning---- ThumbDetailView may not respond to '-view'
// add subviews to container view
[[COLOR="SandyBrown"]self.view [/COLOR]addSubview:lblprodNm]; // warning---- ThumbDetailView may not respond to '-view'
}
Plz suggest how to add subView to existing subview