应用分析
当应用程序发布版本的时候,我们可能会需要收集一些数据,比如说程序被使用的频率如何。这个时候大多数的人使用PinchMedia来实现。他们会提供我们可以很方便的加到程序里面的Obj-C代码,然后就可以通过他们的网站来查看统计数据。
Time
Calculate the passage of time by using CFAbsoluteTimeGetCurrent().
CFAbsoluteTime myCurrentTime = CFAbsoluteTimeGetCurrent(); // perform calculations here
警告窗口
显示一个简单的带OK按钮的警告窗口。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"An Alert!"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];