开发者

How do I call - (void) viewDidAppear:(BOOL)animated from another method?

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

- (void)pickAndDecodeFromSource:(UIImagePickerControllerSourceType) so开发者_JS百科urceType 

I want to call following method inside the above one.

- (void) viewDidAppear:(BOOL)animated 


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
} 


You can always call the delegate methods directly:

[self viewDidAppear:YES]

Called from inside your method should work.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜