addSubview insertSubview aboveSubview bit confused as to why it does not work
- by John Smith
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?