I’ve gotten that issue a lot as well. For me, it worked after I restarted my laptop.
Hope this helps!
Post
Replies
Boosts
Views
Activity
Oh, I see. Thank you so much!
Hi,
I also had the same issue on the iPad Pro 11" simulator. Cleaning the build folder (Command-Shift-K) worked for me.
Hope this helps!
Not sure if this is the same thing, but I've also bumped into an issue with the iPad Pro 11-inch simulator's dimensions. On portrait, the width behaves as though it is a lot longer than the actual device's width. So whenever I try to place an object anywhere based off the screen width, it ends up somewhere entirely different. It works perfectly fine on the other simulators though.
Also, I'm on Xcode 12.2, so if it's a bug, I'm guessing they still haven't fixed it yet :(
Thanks for the reply! Here's my code for updating the data
func autosave(note: Note) {
let updateTitle = self.title
let updateBodyText = self.bodyText
let updateDateModified = Date()
viewContext.performAndWait {
note.title = updateTitle
note.bodyText = updateBodyText
note.dateModified = updateDateModified
do {
try viewContext.save()
print("Note saved!")
} catch {
print(error.localizedDescription)
}
}
}
And here's where I fetched the data
@Environment(\.managedObjectContext) private var viewContext
@FetchRequest(entity: Note.entity(), sortDescriptors: [NSSortDescriptor(key: "dateModified", ascending: false)], predicate: nil)
var updatedNote: FetchedResults<Note>
Which I passed into the other view, which treats the data like a regular variable (code below is in the second view)
struct NoteMenuItem: View {
var note: FetchedResults<Note>.Element
var body: some View {
HStack {
VStack(alignment: .leading) {
Text(note.title ?? "")
.font(.headline)
.padding(.bottom, 1)
Text(note.bodyText ?? "")
.font(.subheadline)
.lineLimit(2)
}
Spacer()
}
.padding(.leading, 25)
.padding(.trailing, 25)
.padding(.top, 10)
.padding(.bottom, 10)
}
}
I don't think I explicitly reloaded the table, since I assumed it does so itself? Though the data still updates in one of the views correctly.
Same here (only I'm on Big Sur). I either keep getting the not enough space error message, or Xcode almost completely updates but then suddenly stops before finishing.