Questions tagged [core-data]
Core Data is Apple's object modeling and persistence framework for OS X and iOS. Xcode provides an object model editor for specifying entities, attributes, and relationships.
20 questions
0
votes
0
answers
55
views
Counting many to one relationship in Core Data
I tried to create simple application, yet I encountered problem with relationship using Core Data in SwiftUI.
I have 2 simple models, ParentEntity:
...
0
votes
1
answer
59
views
Understanding How To Approach A Permutational Word Search
This question is carried over from StackOverflow... First time posting here, so bear with me.
The topic is constructing a search made up of a given string, and a series of letters, where each of the ...
3
votes
1
answer
891
views
Core Data Wrapper
I built a wrapper in Swift to practice CoreData.
My question is more general, I hope this is acceptable. I wanted to know whether my implementation of this wrapper is correct or poorly implemented ...
2
votes
1
answer
203
views
Quiz app with Practice and Exam modes
I am building a Quiz app in swift (my first app) to practice a few skills (using CoreData, working with plists, UIKit etc.) and later to work with a server which stores the Exercises.
Here's my ...
1
vote
1
answer
638
views
Core-data object with relationships conforming protocol in swift
I have a situation where I have to use protocol to be conformed by NSManagedObject which has relationships with other entities.
My protocol is like:
...
2
votes
0
answers
122
views
Private contexts and their parents in CoreData
I find myself following this pattern a lot in my core data code, which works, but I'm wondering if it is needed...
...
3
votes
1
answer
4k
views
iOS Core Data Model with Swifty JSON
I have been using SwiftyJSON to create my models of Object in Swift.
But recently, I moved to CoreData for saving the objects locally.
I am new to CoreData and want to know the best practices I should ...
0
votes
1
answer
517
views
Passing an NSManagedObjectContext
I've been experimenting with how to pass my managed object context throughout my application in Core Data and I came across an approach that I'd like reviewed.
I've been creating a protocol for all ...
2
votes
1
answer
184
views
Weightlifting calculator
I'm building a simple iOS app using Swift that calculates the One Rep Max weight a user can theoretically lift. User inputs a weight lifted, the number of repetitions and the app uses one of several ...
2
votes
1
answer
1k
views
Table View Controller for selecting and saving user default preferences in an iOS app
This is the Swift code from one of the view controllers in my app that calculates a one rep maximum weight a person can theoretically lift. This particular view controller presents a list in a ...
3
votes
1
answer
853
views
Tracking a geolocation
I have created this ViewController using Swift. Its job is to track geolocation and draw a line on a map and save it to core data object. I just want some advice on ...
8
votes
1
answer
22k
views
Coredata delete all data in an entity
I have this code that I am using to delete all records from an entity. The question is can it be done better or is already the best?
...
10
votes
1
answer
3k
views
Changing image of a UIImageView based on a scrollView contentOffset
My task is pretty simple and my code works, it's just that my code feels a bit clumsy to me (and probably will for you too).
I have a view controller (...
4
votes
1
answer
4k
views
Using NSPredicate with NSFetchRequest in a NSFetchedResultsController
I am learning CoreData and I wanted to have my code reviewed. As usual, I get something to work, then I attempt to refine it.
I have a data model that consists of an Item entity and a subItem entity. ...
5
votes
1
answer
277
views
Store CMTimeRange into Core Data
I wanted to store CMTimeRange structures inside managed objects, so I've worked out the following:
...
2
votes
1
answer
3k
views
Updating UITableView rows from Core Data
I am fetching or querying all the entries from my database (core-data) at three different times in my code, which I find to be an inefficient approach to writing the code.
The method ...
3
votes
4
answers
4k
views
Speeding up storage of about 220000 values in Core Data
I use this code on the app's first run to save about 220000 values into core data. The file Navaids.txt has about 200000 and Waypoints.txt has about 20000 lines, where I get data from each line and ...
5
votes
1
answer
334
views
Core Data model for test-taking iOS app
I'm building an iOS app for test-taking and I want to be sure of my model before proceeding.
I found this post very helpful and tried to implement a simplified version for Core Data.
Here are some ...
3
votes
2
answers
2k
views
NSManagedObject in need of smart setters
I'm just beginning my foray into iOS development and need a code review. I have a custom NSManagedObject that needs some smart setters. I'm new to Objective-C, ...
2
votes
1
answer
787
views
Core Data model of video and entities
I have a Core Data model with two entities: Video and Playlist.
A Video can be a member of ...