small medium large xlarge

Back to: All Forums  Core Data
Code_monkey_pragsmall
30 Jan 2010, 17:46
Fernando López (6 posts)

Hello,

on page 9 you recommend to use the Core Data template. On pages 59, 62, 64 you are reproducing (more or less) what this Core Data template writes. On page 59 you add code to initialize the @Type@ entity. You do not mention if the code on this pages has to be copied or modified according. This is a little bit confusing. Please relate this code with what the template generates.

Regards: iFernando

Avatarsmall_pragsmall
31 Jan 2010, 08:03
Marcus S. Zarra (284 posts)

I would suggest downloading the sample code and comparing it. The Type example you referred to is an addition to the template and demonstrates one (of many) solution to pre-populating a database on initial creation.

Generic-user-small
18 Feb 2010, 22:19
nahuel (1 post)

Hi Marcus, I’m a bit puzzled as well by the code on page 59 used to pre-populate a database on initial creation. If I remove the code from your sample code the application behaves exactly the same (nothing breaks). I’m therefore a little bit puzzled about it’s use.

Thanks for your help

Avatarsmall_pragsmall
19 Feb 2010, 04:29
Marcus S. Zarra (284 posts)

The code merely checks to see if the type table is populated, if it is not then it grabs the default data from the Info.plist and adds it to the table. If you remove it from the app then that table will not get pre-populated but it will still function properly.

You must be logged in to comment