Q:

How to get the time in iOS Programming

I wanted to get random numbers according to time. How do you get the current time in iOS Programming for the iPhone?

A:

NSDate *now = [[NSDate alloc] init]; OR NSDate *now = [NSDate date];
an NSDate object by default will be initialised to the current date.

A:

in addition to the existing answers:
gettimeofday for high accuracy
or
CFAbsoluteTimeGetCurrent if you want a fairly high level interface without an object.

A:

It is actually very simple, refer to this dev document
Also, you seem fairly new to iOS dev and seem to be having problems on basic things, I would suggest downloading from the iTunes Store the Stanford iTunes U iOS programming course

