Questions tagged [nsbatchupdaterequest]
10 questions
4
votes
1 answer
NSBatchDeleteRequest with NSPredicate in swift
How to delete rows from CoreData using NSBatchDeleteRequest with NSPredicate.
I want to delete the records which are older than 30 days.
I dont want to get all the data in the memory and than compare and delete, I want to use NSBatchDeleteRequest,…

Anirudha Mahale
- 2,526
- 3
- 37
- 57
4
votes
0 answers
NSBatchUpdateRequest - How can I calculate new value for property, base on its current value?
I have a simple NSBatchUpdateRequest:
let bur = NSBatchUpdateRequest(entityName: "WLWishlist")
bur.resultType = .UpdatedObjectIDsResultType
bur.predicate = NSPredicate(format: "itemCount = %d", 0)
bur.propertiesToUpdate = ["position": ???] //here I…

Bartłomiej Semańczyk
- 59,234
- 49
- 233
- 358
1
vote
0 answers
NSBatchInsertRequest not updating content in some cases when perform
I'm facing a strange behaviour with NSBatchInsertRequest and I don't seems to understand what is causing my problem.
I have some piece of code that updates local data depending on some remote data changes.
The model that is being updated contains a…

Martin
- 843
- 8
- 17
1
vote
0 answers
Update core data database based on criteria using NSBatchUpdate function
I couldn't find anywhere for the answer. I have a database implemented with simple core data and an entity filled with data. Every time I open the app, I need to go through all database and one column contains a date. If the date is already passed…

Rolandas
- 47
- 6
1
vote
1 answer
NSBatchUpdateRequest not saving Transformable attribute
I have an entity (TestEntity) which contains a "Transformable" attribute which holds an object (MyObjectClass). On initial load, the transformable saves correctly; initialised as below:
TestEntity *test = (TestEntity *)[NSEntityDescription…

user3355301
- 55
- 6
1
vote
1 answer
NSBatchUpdateRequest throwing NSInternalInconsistencyException
I keep getting the following error when trying perform a NSBatchUpdateRequest.
*** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Unknown command type

user346443
- 4,672
- 15
- 57
- 80
1
vote
1 answer
How to inform my NSFetchedResultsController that I changed some objects via NSBatchUpdateRequest?
I created simple NSBatchUpdateRequest:
let bur = NSBatchUpdateRequest(entityName: "WLWishlist")
bur.predicate = NSPredicate(format: "name = %@", "oldname")
bur.propertiesToUpdate = ["name": "newname"]
bur.resultType =…

Bartłomiej Semańczyk
- 59,234
- 49
- 233
- 358
0
votes
1 answer
How to use NSBatchUpdateRequest with dynamic values
I have entity called "Student" which has column called "firstName" and "lastName". My Existing entity looks like this
firstName
lastName
Peter
Morgan
Adam
Hayden
Andrew
Giles
Now, I have created a new attribute called "compositeName"…

Yagnesh Londhe
- 9
- 2
0
votes
1 answer
NSFetchedResultsController doesn't know data was changed with a NSBatchUpdateRequest
TL;DR
Apparently, NSFetchedResultsController doesn't know data was changed on a given NSManagedObjectContext when that change happens by executing a NSBatchUpdateRequest. Is it possible to force NSFetchedResultsController to reload its data so…

Marcos Tanaka
- 3,112
- 3
- 25
- 41
0
votes
0 answers
NSBatchUpdateRequest not making updates
I'm trying to do a batch update and I'm not getting an exception, but it's telling me 0 records are updated. If I run the following code
let request = NSBatchUpdateRequest(entityName: "Order")
request.predicate = NSPredicate(format: "sql_ident IN…

Gargoyle
- 9,590
- 16
- 80
- 145