一般在iOS上做录像都可以直接使用UIImagePickerController。 但有时候难免需要做逐帧的处理,比如实时的滤镜之类的。 参照这个帖子: A (quasi-) real-time video processing on iOS 把使用AVFoundation做录像的代码,做了一个简单的封装。 Delegate可以得到逐帧的彩色或者灰度图,然后就可以加上自己需要的处理了。 代码放在Gihub上:MPVideoProcessor 具体使用请参见Github上的Readme.
Useful references: In order to use different names for icons and launch images in your App, you need to add new entries in your info.plist file. For icons, refer to this: App Icons on iPad and iPhone For launch images, refer to this: App Launch (Default) Images
Here we go. How to write a custom object which can be archived to a text file? Usually, we use NSKeyedArchiver to serialize an object and write it to a file. Correspondingly, NSKeyedUnarchiver is used to get the object from the file. The NSKeyedArchiver’s interface is like this: + (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path; NSKeyedArchiver is a
码农Coding的时候有各种不好的习惯。 比如,不喜欢好好地看框架的文档,一旦找到某一个看起来简单易懂的接口,就一直用它。 如果需要之后的处理,往往简单粗暴。 我们以前管这种情况叫做“裸”。最近又不知不觉地写了比较“裸”的代码。 说实话,这个习惯得改,“裸”写的东西往往不健壮,不可读,效率还不高。成熟框架提供的直接可用的接口必须是第一选择。 NSURL是常用的类,用来描述一段URL的。 需要取得URL中不同部分的时候,我们应该用URL提供的接口, 而不是把它当做一个普通的字符串去手工分析。 比如: http://www.testurl.com:8080/subpath/subsubpath?uid=123&gid=456 NSURL *url = [NSURL URLWithString:@"http://www.testurl.com:8080/subpath/subsubpath?uid=123&gid=456"]; 下面是常用的几个接口,和它们的输出。接口意思都符合相关RFC里的定义。 [url scheme] http [url host] www.testurl.com [url port] 8080 [url path] /subpath/subsubpath [url lastPathComponent] subsubpath [url query] uid=123&gid=456 NSURL 英文版 :] NSURL is widely used, but sometimes we are not following the idiomatic usage. When it comes to access