views:

121

answers:

2

I'm new to iPhone dev,

I'm wanting to start a loop that checks for user input, but the main hook into the program I've written needs to be instantiated and started, I thought viewDidLoad would be the appropriate place to place the code for my sub view controller.

But the actual backgroudn of the VC doesnt get displayed until viewDidLoad has finished so it doesnt work.

Because the loop never allows viewDidLoad to finish.

So where do I write code for an IPhone application?

+1  A: 

You don't write loops to check for user input. The OS does that for you and then delivers the user inputs as events to your app (that is, the OS sends your app messages such as touchesBegan:withEvent: which you can implement).

Ole Begemann
OK I mean I have a loop that is running on a timer as it needs to update regardless of input, the input is recieved using UIButton Outlets.
David
Please edit your question and show us your code.
Ole Begemann
A: 

Timers can be used to periodically perform an action on a set interval. Check out the tutorial from Apple.

willcodejavaforfood