Set Delegate methods on child view controll
<p>I am building an application which should allow the user to scroll through the images. Since I have many images (downloaded from the web), what i doing is I have UP and down button on the parent view, in addition i have the scroll view. Based on the selected option (up or down), I add the ImageClass ( created  a class which extends UIViewController) view to the scroll view. </p>

<p>Now, on the selected view the user can mark a point or do any stuff. </p>

<p>The question is how from the parent view I can call methods of the Uiviewcontroller. I know how I can set the delegate methods but what I want is that parent controller can call any a method say redraw method which would redraw the entire view. </p>

<p>Code:</p>

<pre><code>-(IBAction) down:(id) sender{

    [scrollView2 removeFromSuperview];

}

-(IBAction) down        :(id) sender {

    [scrollView2 removeFromSuperview];
    if(scrollView2 == nil)
        scrollView2 = [[UIScrollView alloc] init];
    [self.view addSubview:scrollView2];
    [self.view sendSubviewToBack:scrollView2];
    [scrollView2 setBackgroundColor:[UIColor blackColor]];
    [scrollView2 setCanCancelContentTouches:NO];
    scrollView2.clipsToBounds = YES;    
    // default is NO, we want to restrict drawing within our scrollview

    scrollView2.indicatorStyle = UIScrollViewIndicatorStyleWhite;

    // CSImageView is a class which of the type UIViewController
    imageVie = [[CSImageView alloc] init];
    [scrollView2 addSubview:imageVie.view];
    [scrollView2 setContentSize:CGSizeMake(1500,1500)];
    [scrollView2 setScrollEnabled:YES];
    [imageView release];
}
</code></pre>

<p>Now, from the parent view controller I want to call say:</p>

<p>imageVie.redraw(); method</p>

<p>Code for CSImageView</p>

<pre><code>@interface CSImageView : UIViewController {

    NSNumber *imageId ;

}

@property (nonatomic, retain) NSNumber *venueId;

-(void) redraw;
@end


@implementation CSImageView


@synthesize imageId;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


-(void) redraw {
    NSLog(@"I am ehre in the test function");
}
@end
</code></pre>

<p>Can you please help me on the same. I am not able to call the redraw method. Any input would be appreciated.</p>
