UIWebView appears null when calling fro a method
- by Alexidze
I have a major problem when trying to access a UIWebView that was created during ViewDidLoad, the UIWebView appears null
here is how i declare the property
@property (nonatomic, retain) UIWebView *detailsView;
the implementation
@implementation iPadMainViewController
@synthesize detailsView;
- (void)viewDidLoad
{
[super viewDidLoad];
detailsView = [[UIWebView alloc] initWithFrame:CGRectMake(500, 0, 512, 768)];
[self.view addSubView:detailsView];
}
When accessing from
- (void)loadDetailedContent:(NSString *)s
{
NSLog(@"%@", detailsView);
}
I get NULL, is it a normal behavior or am i doing something wrong?
here is the touchesBegan that is being called, from the views subclass that is being touched,
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
iPadMainViewController *mycontroller = [[iPadMainViewController alloc] init];
self.delegate = mycontroller;
[self.delegate loadDetailedContent:NewsId];
}