As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Any iPhone Developers out there? CoreData question.

DVGDVG No. 1 Honor StudentNether Institute, Evil AcademyRegistered User regular
edited May 2010 in Help / Advice Forum
Okay, so I just finished my first iPhone Development book, and I'm tinkering around with writing my first application.

There's going to be a UITableView that shows a personal list of games. The top level shows Platforms (360, PS3, Wii, etc.) then drills down into a game list and then a detail view for the game in question.

The problem? I'd like to seed the platform data model with some data so I can verify that it's working before moving on to drilling down to a game list that the user can CRUD. I can find no simple way of doing this, and don't really know what the starting point would be, as the database was provided on the examples I ran in the book.

To put it another way, how do you populate data for CoreData managed objects in a read-only application?

Diablo 3 - DVG#1857
DVG on

Posts

  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited May 2010
    The easiest way to import into CoreData is going to be more complicated than hacking together the Create action. There's no one-step seed process.

    admanb on
  • Options
    DVGDVG No. 1 Honor Student Nether Institute, Evil AcademyRegistered User regular
    edited May 2010
    admanb wrote: »
    The easiest way to import into CoreData is going to be more complicated than hacking together the Create action. There's no one-step seed process.

    Okay. How do I do either of those things?

    I don't need it to be super simple, I just know lots of apps start with data when you install them, and I want to know how that data gets in there since there's no Core Data Populating utility. Looking for a Best Practice here.

    DVG on
    Diablo 3 - DVG#1857
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited May 2010
    To import you would create a CSV file (Comma-Separated Values -- a highly technical term for "data delineated by commas and newlines") and then write a parser that opens the file, separates each line by the commas, and then writes that data into the database. This looks like a good tutorial.

    I can't actually help you hack the create action 'cause I, uh, don't actually know iPhone development. :P I just know a good bit about MVC/CRUD stuff and did some googlin'.

    admanb on
  • Options
    AddaAdda LondonRegistered User regular
    edited May 2010
    There is a good programming thread in Moe's technology tavern that might be worth posting your question to. Definitely know there is some guys working with iPhone that regularly post in there.

    Here's the thread.

    Adda on
    steam_sig.png
    I want to know more PA people on Twitter.
Sign In or Register to comment.