I'm creating an apple watch app but I can't seem to get the simple act of updating the label on a controller to work.
I've tried this in multiple functions but none of them are updating the label from it's default text.
I've added print statements to make sure the functions are being called, and they print to the console as expected. The Label reference is correct as well.
class HomeController: WKInterfaceController {
@IBOutlet weak var walkerTitle: WKInterfaceLabel!
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
print("didAppear")
print(User.Player.getTitle())
walkerTitle.setText(User.Player.getTitle() + " Walker");
}
override func didAppear() {
super.didAppear()
print("didAppear")
print(User.Player.getTitle())
walkerTitle.setText(User.Player.getTitle() + " Walker");
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
print("didDeactivate");
}
}
I've attached an image of the app next to the console (with irrelevant print statements whited out). Any help would be greatly appreciated :)
How do I get the label to update on the controller?
Edit:
I've added the logs before the app is loaded here:
skipping /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim 2021-03-23 19:52:21.689294+1030 PDC Hatch WatchKit Extension[718:30700] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data 2021-03-23 19:52:21.690275+1030 PDC Hatch WatchKit Extension[718:30700] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined. 2021-03-23 19:52:21.944316+1030 PDC Hatch WatchKit Extension[718:30700] [default] +[SPRemoteInterface controller:setupProperties:viewControllerID:tableIndex:rowIndex:classForType:]:2719: Unknown property in Interface description ('PartnerImage') for controller <PDC_Hatch_WatchKit_Extension.HomeController: 0x600001b255c0> 2021-03-23 19:52:21.945384+1030 PDC Hatch WatchKit Extension[718:30700] [default] +[SPRemoteInterface controller:setupProperties:viewControllerID:tableIndex:rowIndex:classForType:]:2719: Unknown property in Interface description ('DailyGoalPercent') for controller <PDC_Hatch_WatchKit_Extension.HomeController: 0x600001b255c0> 2021-03-23 19:52:21.945625+1030 PDC Hatch WatchKit Extension[718:30700] [default] +[SPRemoteInterface controller:setupProperties:viewControllerID:tableIndex:rowIndex:classForType:]:2719: Unknown property in Interface description ('AllEggs') for controller <PDC_Hatch_WatchKit_Extension.HomeController: 0x600001b255c0>
The unknown properties seem to be outlets I reference but have since deleted. I'm not sure why they are still showing up in the logs.