views:

331

answers:

3

It is possible to call one method from inside another. I've implemented this function

- (void)pickAndDecodeFromSource:(UIImagePickerControllerSourceType) sourceType 

I want to call following method inside the above one.

- (void) viewDidAppear:(BOOL)animated 
+3  A: 

I think I understand what you're asking... the question is.. well not there. Nonetheless:

What I think you're asking: "How do I call viewDidAppear from within another method...?"

- (void)pickAndDecodeFromSource:(UIImagePickerControllerSourceType)sourceType
{
 ...
    [myController viewDidAppear:YES]; //Simply call it on whatever instance of a controller you have
 ...
}

If the question was actually "How do I override viewDidAppear?" then this is it:

- (void)viewDidAppear:(BOOL)animated
{
     [super viewDidAppear:animated];
     //YOUR STUFF
     //GOES HERE
} 
Malaxeur
A: 

I'm not sure exactly what you mean, but from the nature of your question I am guessing you are new to Obj-C so I strongly suggest reading Introduction to The Objective-C Programming Language if you have not already. If you have, great! What you are looking for is most likely under Objects Classes and Messaging - Object Messaging - Message Syntax

slf
A: 

Hi

You can always call the delegate methods directly:

[self viewDidAppear:YES]

Called from inside your method should work.

RickiG