Tyler1900d
(Tyler1900d)
1
I am using sqlite3 in my project , i need to create a MyDatabase.db file to store something.
To create this file, what i have tried:
1.IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*FPaths::GameContentDir().ToLower());
2.FPaths::ConvertRelativePathToFull(FPaths::GameContentDir() );
to get a absolute path where i can create my file.
it works fine on Mac/Windows, but on iOS it seems these two uses IOSPlatformProcess.cpp-> BaseDir() , which just return “”.
so ,is there some way to get this path? or do i have to use object-c to get path?
Try FPaths::GameSavedDir()
Tyler1900d
(Tyler1900d)
3
I figure it out:
using:
NSArray *documentArr = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentPath = [documentArr firstObject];
NSString *path2 = [NSString stringWithFormat:@"%@/mydata.db",documentPath];
FString path(path2);
3DGeeks
(3DGeeks)
4
is this code in Object C ?
It is… you can do that!
I still don’t know why you wouldn’t use GameSavedDir though, that’s where I put my downloaded content. Probably a reason though…! 