problem with refresh uiview and update variable

Discussion in 'iPhone/iPad Programming' started by yowsing, Apr 27, 2011.

  1. macrumors newbie

    Joined:
    Apr 27, 2011
    #1
    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...
     
  2. macrumors newbie

    Joined:
    May 10, 2011
    #2
    same problem

    hi,

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

    thanks!
     

Share This Page