2

I'm working on an iOS App fetching html content from a sqlite database and loading it into webviews through custom objective-c objects.

I'm willing to implement NSCoding on these custom objects so as to avoid fetching content from sqlite.

Anyone has some experience on how much more beneficial using NSCoding would be rather than fetching from the sqlite db ?

Thanks in advance,

Sooriah Joel
  • 111
  • 2
  • 6

2 Answers2

2

From my experience, NSCoding requires WAY less lines of code than sqlite db management. Less code equals less bugs more often than not.

Peter Sarnowski
  • 11,900
  • 5
  • 36
  • 33
1

I'm not sure it is beneficial. Object archiving is nice but it really requires that all your objects in the object graph implements NSCoding protocol. There are other appropriate persistence mechanisms for what you're doing. Sqlite is good and fast, and if you only do what you're saying (fetching HTML content from DB) Coredata might even be better. Setting up Coredata and starting to fetch and store stuff can be done really quickly.

I usually prefer to get away from NSCoding archiving which is way to smart for what I usually need.

Iman Zarrabian
  • 230
  • 2
  • 10