2013-05-03 56 views
0

我已经发布“HERe”。不更新子视图的UIView?

Here actually What I need to Deserve

如果我把代码[self loadLocationView]这部分UIButton and ViewDidLoad methodIt works fine here.

但每当我选择从TableVeiw的位置,并从configureViewSlider方法调用,它被调用的方法loadLocationView但不更新UI。 这里我已经尝试过。

-(void) configureViewSlider 
{ 

    if (_detailItem) { 
     Location=[_detailItem description]; 
     //[self performSelectorOnMainThread:@selector(btnLocations:) withObject:nil waitUntilDone:false]; 
     //[btnLocations sendActionsForControlEvents:UIControlEventTouchDown]; 

     // [self loadLocationView]; 
    [self performSelectorOnMainThread:@selector(loadLocationView) withObject:nil waitUntilDone:NO]; 
     //[self loadView]; 
     NSLog(@"Location %@", Location); 

    } 
} 


-(void) loadLocationView 
{ 
    _viewLocBangalore.frame= CGRectMake(10, 10, 303,255); 
    [self.view addSubview:_viewLocBangalore]; 

    // [self.View bringSubviewToFront:_viewlocBangalore]; 
    //[_viewLocBangalore setNeedsDisplay]; 

} 

我还有什么要做到这一点。我尝试过所有可能的方法。但没用。

请至少做一些建议,我准备好接近任何准备值得我的任务的方式(我..我..添加了一个UITableVieContrller有位置,当用户触摸位置时,UIView应该更新)。

+0

通过放置中断点,检查一次您的loadLocationView方法是否正在主线程中调用。 – 2013-05-03 12:19:34

+0

是的,我在问题中也提到过。即使它正在接听并打印Log值。 – 2013-05-03 12:24:00

+0

好的,一旦尝试直接放置视图,无需过渡动画。 – 2013-05-03 12:27:01

回答

0

为什么你调用configureViewSlider方法,然后loadlocationview方法直接在位置选择tableview方法中添加这个视图: _viewLocBangalore.frame = CGRectMake(10,10,303,255); [self.view addSubview:_viewLocBangalore];

+0

为了理解目的。但即使它仍然不起作用。 – 2013-05-06 04:35:56

+0

检查子视图NSLog(@“subView:%@”,[self.view subviews]); – SnakingPrabhu 2013-05-06 09:36:10