문제

I'm trying to use https://github.com/p2/Redland-ObjC, that compiles and runs fine on iOS to store RDF triples in the iOS sqlite3 database. However, documentation is very light, and Redland-ObjC seems to only use Redland storage with an in-memory hash table.

However, it's mentioned in the Readme of https://github.com/p2/Redland-ObjC that we might want to include libsqlite3 to use persistent storage.

Is it possible ? If yes, how to tell Redland to use ios's sqlite3 API ? (I don't see any code in https://github.com/p2/Redland-ObjC that does that).

Thanks a lot.

도움이 되었습니까?

해결책

I haven't used the wrapper myself and my Objective-C is rusty, but reading the source suggests that you can do the following:

  • Use something like [RedlandStorage initWithFactoryName:@"sqlite" identifier:@"databasename.sqlite" options:@""] to create a new sqlite storage object.

  • Use something like [RedlandModel initWithStorage:storage] to create a new model using that storage as the backing store. (The default [RedlandModel init] creates the model with the default in-memory hashes backing store.)

Then do whatever you would otherwise do with the model.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top