So essentially I want the UILabel to increment every time a button is clicked. I currently have something like this:
- (IBAction) incrementCount {
[buttonCounter = buttonCounter++]; // Increment by 1.
}
I declare button counter to be an int in the header file. Is that the right way of doing it? Furthemore, upon click, i’d like a time stamp printed as well. Is there a built-in function for fetching a time stamp? Thanks.
use:
You can get a current date and time using
[NSDate date]
To get timestamp, use
[[NSDate date] timeIntervalSince1970] * 1000;