UIWebView appears null when calling fro a method

Posted by Alexidze on Stack Overflow See other posts from Stack Overflow or by Alexidze
Published on 2012-03-25T18:46:38Z Indexed on 2012/03/26 5:29 UTC
Read the original article Hit count: 177

Filed under:
|
|
|

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];
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c