0

I resort to your expertly advice because I am sort of "new" to Objective-C, I have read a couple of books and docs (namely Aaron Hillegass & Stephen G. Kochan's books), but some things are still unclear to me, for lack of practise. To put you in context, I have a NSDocument project that uses Core Data for storage.

I struggle with 2 things right now: reading/writing to files, and table views ^^

So my first question is about Core Data : is it only able to save in SQL, XML or Binary format ? Or can I use core data to read/write in any format, according to what I declared in the plist file ? I am trying to work with .po files, and I want to display the translations in a table view containing 2 columns (1 for the msgid and the other for the msgstr).

To read and write files in the po format and display lines in my table view, I most likely need to parse the files using line endings and characters such as "#"as delimiters. I haven't gotten around to doing that yet (I have no idea how to do that yet!), but I would like to know if it is possible or if I need to restart my project that doesn't use Core Data...

Please DO NOT just throw links to the apple documentation at me, it's the most confusing thing ever, and feels like it's made for experts only! I need me some human-readable explanations :)

Thanks a bunch for any help and advice you can give me!

Dyn
  • 395
  • 3
  • 18

1 Answers1

1

It is possible to write a different storage format for Core Data, but it is not easy and it sounds like you are not at a level where that is a possibility (no shame there, I'm not either).

If you are only displaying data from the .po files then there is no need to use CoreData. CoreData is meant to provide a file storage solution. You create/edit data and save it using coredata. If you have no intention to create and edit data then get rid of coredata, it will only get in the way.

sosborn
  • 14,676
  • 2
  • 42
  • 46
  • Grazzier por la response sosborn ! You are right indeed, I am definitely not at a level where I can do that. So, do I need to start a brand new project then, or can I just NOT USE CORE DATA? and if I can "turn it off" in my project, how do I do that ? – Dyn Jun 18 '11 at 11:50
  • For the record, I will display the content of the PO file in my table view, then edit it, and I will need to save the edits in the same format -- it's no problem without core data right ? – Dyn Jun 18 '11 at 11:53
  • I would start a new project and deselect the "Use Core Data" option. – sosborn Jun 18 '11 at 11:55
  • You will be able to edit the PO file, but it will take some effort (naturally). I wouldn't worry about that yet though. First worry about loading and displaying the file. Once you have that going then you can move on to editing the files. – sosborn Jun 18 '11 at 11:57
  • That is very true. My first goal is to be able to open, read, parse and display the contents of the .po file. I do have a 3-day intensive obj-c training next month though, so I am counting on that to clear things up (regarding technical terms, memory management etc...) for me. Anyway... another question : is there no way to just switch my project to not use Core Data? I have a loooot of things implemented already, it's quite an ambitious project (for my lebvel I mean), and having to redo it all is a pain in the neck ! – Dyn Jun 18 '11 at 12:48