Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yowsing

macrumors newbie
Original poster
Apr 27, 2011
1
0
hi everyone,
i encounter the following issue, where i have 1 UIView (FirstView) call another UIView (SecondView), then after that i would wanted to update the variable in the firstview and refresh the first view but i seems not able to find a way to do it, can anyone guide me on that?

FirstView.h
Code:
@interface FirstView : UIViewController <UIApplicationDelegate, UITableViewDataSource, UITableViewDelegate>{
    NSMutableArray *arrTaskList;
    
}
@property(nonatomic,retain) IBOutlet NSMutableArray *arrTaskList;

@end

FirstView.m
(I display the second view using the addsubview method)
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{    
    if (indexPath.row == 0)
    {
        
        SecondView *vwSecView = [[SecondView alloc] init];
        [self.view addSubview:vwSecView.view];
    }
    
}

SecondView.m
(After user complete the task, they click a button
Code:
-(IBAction) fncTaskCompleted:(id)sender
{
    [self.view removeFromSuperview];
    
    At here 
    I Would like to Update my FirstView variable: arrTaskList
    And
    Refresh FirstView
    
}

i not able to use the below method because the xcode told me it will not response to the delegate method...

FirstView *delegate = (FirstView*)[UIApplication shareApplication] delegate];
[delegate.arrTaskList removeObject:0];


can anyone guide me a direction on how to accomplish this?
thank you...
 
same problem

hi,

i have exactly the same problem. please let me know if you find a solution.

thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.