How to have Xcode find the newest version of a file

Posted by Arian on Stack Overflow See other posts from Stack Overflow or by Arian
Published on 2013-11-07T21:52:29Z Indexed on 2013/11/07 21:52 UTC
Read the original article Hit count: 202

Filed under:
|
|
|

Currently I have a SQLite database, that is set statically to use database01.sqlite... but what I need is a way to have the file path find the newest version of the database file that exists.

For example: If a database file of database04.sqlite is available, it should use that one instead.

Below is my current code:

NSString *databaseDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *filePath = [databaseDirectory stringByAppendingPathComponent:@"database01.sqlite"];

© Stack Overflow or respective owner

Related posts about ios

Related posts about objective-c