views:

55

answers:

2

when i switch to a new view instantaneously a random image is selected via the arc4random function and displayed in the view can some one give me direction on how to achieve the instant execution of random function selection process with out a button to prompt the random function process. any examples of code, were should the code be placed etc

A: 
- (void)viewDidLoad

You can put your image selecting code in this function and when the nib is created and loaded control will pass to it.

Alternatively, you can use

-(void) viewWillAppear:(BOOL)animated

To have the image appear fresh each time you make the view visible.

davbryn
thanks davbryn ill get on to it
johnathan bridges
A: 

Welcome to StackOverflow.

Try putting it in viewDidLoad or viewDidAppear.

See also: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

Also, FYI, you will get more answers to your questions if the questions themselves are readable. It took me a couple of parses to understand your problem. Try spell checking and adding some grammar, you'd be amazed at the difference it'll make.

AlexC
thanks alex great help
johnathan bridges