开发者

Create a Blank File If Not Already Exist?

I added a blank file to the application resources but it is not found in the build, how would i programmatically check and create a file if it d开发者_高级运维oesn't already exist?


First of all you can write only to application Documents directory.

- (BOOL)createFileAtPath:(NSString *)path contents:(NSData *)contents attributes:(NSDictionary *)attributes

NSFileManager doc here


You can do this as a custom build step (which is in fact a simple shell script). For example, just add touch yourfilename

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜