Right now the Attribute names must match the names in JSON to use batch insert request. You can use regular inserts and batch them though.
Post
Replies
Boosts
Views
Activity
Did you add the app group entitlements correctly in all targets?
Can you just AirDrop it to a differnet user?
I'm using the following merge policy to skip certain attributes by being trumped. I didn't test it with relationships yet, but I don't see why it shouldn't work.It would be great if you give some feedback here when you test it.override func resolve(constraintConflicts list: [NSConstraintConflict]) throws {
guard list.allSatisfy({ $0.databaseObject != nil }) else {
print("NSMergeByKeepingPropertiesPolicy is only intended to work with database-level conflicts.")
return try super.resolve(constraintConflicts: list)
}
for conflict in list {
for conflictingObject in conflict.conflictingObjects {
for key in conflictingObject.entity.attributesByName.keys {
let databaseValue = conflict.databaseObject?.value(forKey: key)
if key == #keypath(MyNSManagedObject.MyRelationshipIDontWantToBeUpdated) { continue }
conflictingObject.setValue(databaseValue, forKey: key)
}
}
}
try super.resolve(constraintConflicts: list)
}
You can’t just ran your app 5min in the background.. You can schedule a timed local notification with alarm though
I don't think you are in the right forum section.But take a look at: https://developer.apple.com/documentation/corenfc/building_an_nfc_tag-reader_app
Sorry, I have no experience with obj c."The way i plan to implement is to just observe if there are any changes. If there are then run the original query to retrieve those changes."That's exactly what HKObserverQuery does. See documentation: https://developer.apple.com/documentation/healthkit/hkobserverquery/executing_observer_queries-> "The observer query’s update handler does not receive any information about the change—just that a change occurred. You must execute another query, for example an HKSampleQuery or HKAnchoredObjectQuery, to access the changes."
Just to be sure, you did set the "Push Notifications" capability in your macOS app?
You are welcome. It would be nice to chose an accepted answer to mark your original question as answered.
Check out HKObserverQuery
If you are comparing against > previous day and < next day, it's perfectly correct to show the total of today and previous day. Because it includes the times. if your previous day is set to 0:00 and you check against > 0:00 then 0:01 already qualifies. Thats still data for yesterday, but thats what you asked for in your predicate. Please see my previous answer again. You first need to start of the day for today. Then startDate needs to be bigger or equal to that and smaller to start of next day. So if you want everything for today, you need:today at 00:00 <= startDate < tomorrow at 00:00
My swift version looks like this:let today = Calendar.current.startOfDay(for: Date())
let tomorrow = Calendar.current.nextDate(after: today, matching: DateComponents(hour: 0), matchingPolicy: .nextTimePreservingSmallerComponents) ?? Date()
let predicate = NSPredicate(format: "startDate >= %@ AND startDate < %@", today as NSDate, tomorrow as NSDate)
Is your function "reloadTableData()" called if you search?In general I would not check in every function if user is filtering and then access different lists.I would always use self.filteredSectionCustomers and make sure, that if there is nothing in the search field, to simply copy your self.sectionCustomers to self.filteredSectionCustomers. This way self.filteredSectionCustomers is always correct filled. If you change self.filteredSectionCustomers you will also have to reload your tableview
Sounds like you need to implement a new model version if it crashes. See:https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/Introduction.html
You could just add a 'name_lowercased' attribute to your data model and make this your unique constraint instead. You can fill your object property with your 'name' and a .lowercased() call then.After all the name "aPpleS" is different from "Apples".If you really don't want that, there also is the option to implement your own MergePolicy, but that seems to be too much for your case.