iOS 15: One-to-many relationships with @FetchRequest and SwiftUI - Core Data SwiftUI Tutorial 7/7

  Рет қаралды 14,758

Paul Hudson

Paul Hudson

Күн бұрын

Пікірлер: 40
@sxlx
@sxlx 2 жыл бұрын
One man has many dogs. Many dogs have one man.
@LeoJunquera
@LeoJunquera Жыл бұрын
Another great video. Do you have an example of a core data and a form supporting a many-to-many relationship?
@LeoJunquera
@LeoJunquera Жыл бұрын
Great tutorial. Do you have a many to many example? One where you might have to keep additional in the intermediate table? Like Recipe/Ingredient with an intermediate table for amount, or User/Rating/Restaurant, etc.
@cliffspencer
@cliffspencer 3 жыл бұрын
Paul, shouldn't those convenience properties be called unwrapped* as you are actually unwrapping the optional?
@twostraws
@twostraws 3 жыл бұрын
I went back and forward on the naming a few times, because although I'm unwrapping them I'm not *just* unwrapping them - it's not like a force unwrap, but instead some wrapper code that provides a default value. I've used unwrapped* elsewhere a few times, so it's not like I'm firmly committed to the choice 🙂
@mutualrespect4411
@mutualrespect4411 2 жыл бұрын
@@twostraws I went with unwrappedWrapped
@yanhao-li
@yanhao-li 2 жыл бұрын
Love the dogs!
@uniquecrafter4432
@uniquecrafter4432 2 жыл бұрын
If I want to store URLs and UUIDs in Core Data, what should I nil coalesce to when creating those computed properties? A new empty URL instance (i.e URL(fileWithPath: "") and a new UUID() instance respectively?
@LeoJunquera
@LeoJunquera Жыл бұрын
Couldn't you have the classes automatically created and create an extension class for the object and still use Codegen = class definition?
@isthorify
@isthorify 2 жыл бұрын
Thx for this. I followed this tutorial using swift playground on the iPad. It works fine, but is it possible to set Contraints for Entity manually, not using Xcode ?
@AndyJMacLeod
@AndyJMacLeod 2 жыл бұрын
Why did Paul call those variables wrappedShortname (etc) rather than unwrappedShortname? Thanks.
@АльфредГордан
@АльфредГордан Жыл бұрын
OMG. this video is mind-blowing
@midlifematt
@midlifematt 3 жыл бұрын
I am in the mood for candy now 🍬… those dogs though, wonderful 😊 Love the videos 👍🏻
@tommy9576
@tommy9576 2 жыл бұрын
Such a great tutorial, you helped me so often!
@RoustamManookian
@RoustamManookian Жыл бұрын
Hi, how to fetch only the Countries without the relationship entities?
@hamidehsheikh2619
@hamidehsheikh2619 Жыл бұрын
Such a great tutorial, and you are the best teacher. Thank you so much🥰
@kafran
@kafran 2 жыл бұрын
Wouldn't it be better to put the wrapped properties as an Extension in another file so it doesn't get rewritten?
@tiIIus
@tiIIus 2 жыл бұрын
Thank you, that's such great tutorial!
@beanberg
@beanberg Жыл бұрын
Thanks so much for your tutorial! It helped me lots
@ec92009y
@ec92009y 2 жыл бұрын
How many treats do they get everyday?
@Alshafi
@Alshafi 2 жыл бұрын
how to clean all the errors and warnings?
@ColeHoney-e5c
@ColeHoney-e5c Жыл бұрын
Command + Shift + K
@devsmond
@devsmond 3 жыл бұрын
How can I create data and display it when the app starts, without having to click the button first?
@nabs
@nabs 3 жыл бұрын
Anywhere where your code already runs without an explicit interaction (like a button press) would work. An example would be the ContentView’s initializer, or in CoreDataProjectApp before ContentView is initialized. Just remember to remove that code after it runs once, otherwise you’d be attempting to create and save that data on each run
@devsmond
@devsmond 3 жыл бұрын
​@@nabs Thank you for this! I tried messing around with the initializer before asking this question but I can't get a full grasp on how to use it with my data model.
@梁非凡-h6i
@梁非凡-h6i 2 жыл бұрын
constraints failed to work in Xcode Version 14.1 beta (14B5024h) sometimes, I added constraints for shortName but I can still see a bunch of entries with the same short name, I even downloaded your project 12 from github and directly run on my mac, still no luck. But previously it worked perfectly for singers with same names, really strange.
@iurii513
@iurii513 2 жыл бұрын
Same thing here. Did you get a solution?
@JonSweeney26
@JonSweeney26 2 жыл бұрын
​@@iurii513 Be sure to update the Persistence file generated in Xcode 14.0+. I added the self.container.viewContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump to line 55, after the container...MergesChangesFromParent = true in the initializer.
@aleixplanasguibas
@aleixplanasguibas 2 жыл бұрын
@@JonSweeney26 what do you mean to line 55? It isn't working for me and I can't find any information regardless the merge policy getting old. Could you be more specific? Thanks!!
@maxmaxmaxmaxmaxmaxmaxmaxmax1
@maxmaxmaxmaxmaxmaxmaxmaxmax1 Жыл бұрын
To your DataController file, add the following code after your closing brace for container.loadPersistentStores (probably line 15) self.container.viewContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
@jlleee
@jlleee Жыл бұрын
I thought I had the same but I missed the part where he added try? moc.save() at the end
@seungjunlee00
@seungjunlee00 2 жыл бұрын
Thanks you sooo much foir this awesome great video!
@sirpoohbehr4793
@sirpoohbehr4793 2 жыл бұрын
Insanely helpful tyvm :D
@udesai2011
@udesai2011 3 жыл бұрын
Is there a working code for download available?
@DaveyonMayne-ok
@DaveyonMayne-ok 2 жыл бұрын
Hola. Could you make a video on how to update/delete an entity?
@MoAdel92
@MoAdel92 2 жыл бұрын
He did before
@MoAdel92
@MoAdel92 2 жыл бұрын
Revise bookworm series
@xingguohuang4487
@xingguohuang4487 Жыл бұрын
@@MoAdel92Could you please share the link? I looked everywhere but couldn’t find it.😂
@DavidNitzscheBell
@DavidNitzscheBell 2 жыл бұрын
Well, well, well....Who would have thought that I'd learn something about the origin of candy bars in a video about SwiftUI???? I was all ready to "correct" you about the origin of Mars, Twix and KitKat (I'm from the US and, of course, *everything* was invented in the US, right? ) but life has taught me to look things up first. And, lo and behold, invented in UK!!! So, at least I can blame the UK for being the US's origin story for fascination with junk food. ;)
@dannytong2010
@dannytong2010 2 жыл бұрын
Power of Hungry Dogs lol 🤣
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 187 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 60 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 154 МЛН
Как сделать ДИАЛОГИ в CONSTUCT 3
8:48
Wishl - гамэ мэкир
Рет қаралды 138
Core Data One-To-Many SwiftUI
20:54
Swift Arcade
Рет қаралды 7 М.
Relationships | Core Data #3
11:55
Sam Meech-Ward
Рет қаралды 3,9 М.
Donny Wals: Using Core Data in a Modern SwiftUI Application
41:18
Swift Heroes
Рет қаралды 13 М.
Saving Transformable Types Using Core Data
25:36
azamsharp
Рет қаралды 8 М.
Мучительная смерть  HUAWEI Mate XT
0:58
Кик Обзор
Рет қаралды 4,3 МЛН
Гениальная замена кнопки CTRL в США
0:15
Сергей Милушкин
Рет қаралды 4,2 МЛН
Cách tính trở kháng loa khi đấu nối tiếp và song song!
0:20
👍🏻 Samsung Galaxy A56 - ЕГО ЗАХОТЯТ ВСЕ! Xiaomi так не сможет…
12:05
Thebox - о технике и гаджетах
Рет қаралды 242 М.