A touch of help for a newbie if possible #124424
Replies: 5 comments 1 reply
-
Hey @OriginBeta - can you provide more context on what you're trying to accomplish and what errors you're running into? Giving a few more details might help someone give you a nudge in the right direction! |
Beta Was this translation helpful? Give feedback.
-
So the basics are simple the app is used to track animal husbandry data on one tab, and contains the basics of care for numerous animals on another. The idea is that the user can drill down on a data tab to locate said data, additionally when the user is tracking, I am trying to get this force the user to select the animal by unique name and then track data within that. Ideally it will pull from the animal data to include this care data on the animal tracking page |
Beta Was this translation helpful? Give feedback.
-
@OriginBeta I'll make a pull request |
Beta Was this translation helpful? Give feedback.
-
@OriginBeta I'll send the pull request when am done |
Beta Was this translation helpful? Give feedback.
-
Based on the provided code, there are a few errors that need to be addressed:
To fix this error, you need to implement the struct Animal: Hashable {
// ...
func hash(into hasher: inout Hasher) {
hasher.combine(commonName)
}
static func ==(lhs: Animal, rhs: Animal) -> Bool {
return lhs.commonName == rhs.commonName
}
}
The error occurs because you're trying to pass an instance of Here's how you can pass it as a parameter: @main
struct ReptileTrackingApp: App {
var body: some Scene {
WindowGroup {
MainView(categories: ["Lizards", "Amphibians", "Snakes"], reptilesAndAmphibians: reptilesAndAmphibians)
}
}
}
This error occurs because you're trying to pass an instance of Here's how you can do it: CareDetailView(animal: selectedAnimal)
.padding()
This error occurs because you're trying to assign a Here's an example of how you can do it: Picker("Select Animal", selection: $selectedAnimal) {
ForEach(animalsInCategory, id: \.self) { animal in
Text(animal.commonName)
.tag(Optional(animal))
}
} After making these changes, your code should compile without any errors. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
Hello all,
total newbie but working as hard as I can to learn. seem to have made the mistake of hoping chat gpt could help line me up and instead it appears I am now worse off than before. I could really use some help getting the base functionality to work in this. Its a super simple app and wont ever earn anything lol
https://github.com/OriginBeta/Vulcan-Husbandry/blob/fac77c855e52f16708592478c790e7b52ba5008c/.github/workflows/objective-c-xcode.yml
Beta Was this translation helpful? Give feedback.
All reactions