addSubview insertSubview aboveSubview bit confused as to why it does not work

Posted by John Smith on Stack Overflow See other posts from Stack Overflow or by John Smith
Published on 2009-08-23T18:23:11Z Indexed on 2010/03/23 15:03 UTC
Read the original article Hit count: 770

Filed under:
|
|

I'm a bit confused all as to why the belowSubview does not work.

I'm adding some (subviews) to my navigationController and all of that works well.

-(UITableView *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

... 
...

    [self.navigationController.view addSubview:ImageView];
    [self.navigationController.view addSubview:toolbar];

add some point in my app I wish to add another toolbar or image above my toolbar.

so let's say I'm doing something like this

    -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
    {
    ...
    ...

        [self.navigationController.view insertSubview:NewImageView aboveSubview:toolbar];
//crucial of course [edit]
            rvController = [RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle] mainBundle];
rvController.CurrentLevel += 1;
rvController.CurrentTitle = [dictionary objectForKey:@"Title"];
[self.navigationController pushViewController:rvController animated:YES];
rvController.tableDataSource = Children;
[rvController release];

However this doesn't work.. Does anyone know what I'm doing wrong here ... Should I have used something else instead of addSubview or is the problem somewhere else?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone