Is there anyway to add in the code to narrow why the JSON file is invalid? Like pin pointing the issue?
Post
Replies
Boosts
Views
Activity
MessageSendFailure: Message send failure for update
==================================
| RemoteHumanReadableError: The operation couldn’t be completed. XPC error received on message reply handler
|
| BSServiceConnectionErrorDomain (3):
| ==NSLocalizedFailureReason: XPC error received on message reply handler
| ==BSErrorCodeDescription: OperationFailed
This is what is said when i try to resume to try to preview.
Using the JSONLint that Eskimo Suggested i was able to locate the invalidation with the JSON file which was an extra comma before one of the coordinates. Now i am getting the error that follows:
MessageSendFailure: Message send failure for update
==================================
| RemoteHumanReadableError: The operation couldn’t be completed. XPC error received on message reply handler
| BSServiceConnectionErrorDomain (3):
| ==BSErrorCodeDescription: OperationFailed
| ==NSLocalizedFailureReason: XPC error received on message reply handler
I was supposed to take a course that did this at the local school, but they are no longer offering the course. So Im looking for assistance from anyone who can assist.
@Claude31 thank you so much for letting me know that was my mistake, i appreciate your guidance.
This is the Rating form Im trying to add to the LandmarkDetail that keeps showing up in a small corner with it looks like a spacer before it. im not sure how to fix the issue to so that the form is inline with the landmarks, but i want the review page on each of the landmarks. Thank you!
struct RatingForm: View {
@Binding var rating: Int
@State private var review: String = ""
var label = ""
var maximumRating = 5
var offImage: Image?
var onImage = Image(systemName: "star.fill")
var offColor = Color.gray
var onColor = Color.yellow
var body: some View {
Form {
VStack {
HStack {
Text("How would you rate this Landmark")
}//hstack
HStack{
if label.isEmpty == false {
Text(label)
}//if label
ForEach(1..<maximumRating + 1, id: \.self) { number in
image(for: number)
.foregroundColor(number > rating ? offColor : onColor)
.onTapGesture {
rating = number
}//tapgesture
}//foreach
}//hstack
_HSpacer()
HStack{
Text("Add a review")
}//hstack
HStack{
TextField ("Review the Landmark",
text: $review
)
.frame(
width: 300,
height: 50,
alignment: .center)
}//hstack
}//vstack
Button(action: {
print("Button tapped")
}, label: {
Text("Submit Review")
.frame(
width: 285,
height: 50,
alignment: .center)
.background(Color.pink)
.foregroundColor(.white)
.cornerRadius(8)
}//label
)//button
}//form
}//body
func image(for number: Int) -> Image {
if number > rating {
return offImage ?? onImage
} else {
return onImage
}//else
}//func image
}
struct RatingForm_Previews: PreviewProvider {
static var previews: some View {
RatingForm(rating: .constant(4))
}//static var
}//struct