Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-22-2011, 09:04 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: Wien/Austria
Posts: 242
StefanL is on a distinguished road
Default OverWrite all Data in CoreData "Table"

Hi Folks,

I am fetching master data from a json file and populate my Entities with it. Now I need to update my entities frequently to keep the app on the valid. How can I achieve this? I need to overwrite the whole Entities...

Code:
        NSManagedObjectContext *context = [self managedObjectContext];
        
        Stamm *insert = [NSEntityDescription
                            insertNewObjectForEntityForName:@"Stamm" 
                            inManagedObjectContext:context];
        insert.vendor = @"Grazer Verkehrsbetriebe";
        insert.town = @"Graz";
        insert.image  = @"graz_small.png";
This is how I add the data to the Core Data...

Thanks for your help!

BR,

Stefan
StefanL is offline   Reply With Quote
Old 11-23-2011, 07:19 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

You would need to individually delete each object; you can't do a single mass deletion like you can with a SQL statement.

If you are going to have a small number of items in your database, perhaps this will be OK. But if you are putting lots of data in there that you will need to refresh frequently, you might find it to be too slow. With a large number of objects that need to be frequently deleted and replaced, it might be better to just use SQLite directly rather than using Core Data (but only if you find Core Data slows things down too much).
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 397
16 members and 381 guests
7twenty7, chiataytuday, Clouds, dedeys78, Duncan C, e2applets, EvilElf, iekei, ipodphone, jeroenkeij, leostc, mbadegree, Murphy, QuantumDoja, sacha1996, Sami Gh
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0