[英]adding datetime on video while video recording in iPhone
i am new in iPhone sdk. 我是iPhone SDK的新手。 I want to develop a project in which i need to record current date and time along while i am recording video. 我想开发一个项目,在录制视频的同时我还需要记录当前的日期和时间。 i am not getting how to do that. 我不知道该怎么做。 please help me out here. 请在这里帮助我。 please provide a sample if possible. 请提供一个样本(如果可能)。
Thank You 谢谢
NSDate date
will return a NSDate object with the current date and time. NSDate date
将返回带有当前日期和时间的NSDate对象。 Sample code to find the current date and time is as follows 查找当前日期和时间的示例代码如下
NSDate *testDate=[NSDate date];
NSDateFormatter *formatterNew = [[NSDateFormatter alloc] init]; [formatterNew setDateFormat:@"MM/dd/yyyy hh:mm:ss"];
NSString *dt = [formatterNewstringFromDate:testDate];
NSString *strDateTaken=dt;
NSLog(@"date=%@",strDateTaken);
[formatterNew release];
and you can easily save this date in NSUserDefault for later retrival 并且您可以轻松地将此日期保存在NSUserDefault中以供以后检索
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.