Hi.
I have created a test application for HomeKit on iPad Mini (5th generation) with iOS 14.4 on Xcode 12.4.
The app is only for iPad, the supported orientation is landscape only and it's very basically : one view controller with one button when tapped execute the following code.
HomeStore.shared.homeManager.primaryHome?.addAndSetupAccessories(completionHandler: { (error) in
if error != nil
{
// DO SOMETHING
}
else
{
// DO SOMETHING ELSE
}
})
When the button is tapped the app crash with the following reason :
** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [HMSetupViewController shouldAutorotate] is returning YES'
I wan't to support the portrait orientation also, because I want the locked in landscape.
Is there a way to avoid the crash or is there a bug in HomeKit framework ?
Post
Replies
Boosts
Views
Activity
Hello.
I have a strange issue with localized text.
On some device (iPhone X with iOS 15.2.1 and iPhone 14 Pro with iOS 16.7.2) the localized isn't loaded and the UILabel is empty.
In all the others UILabel in the view the localized text is correctly showed.
It works perfectly on iPhone 8 with iOS 16.4.1, iPhone 8 with iOS 16.7 iPhone 12 with iOS 17.3, and also on iPhone 14 Pro 17.2 Simulator.
Below the text from the localizable file:
"m_alert_message" = "E' disponibile nello store la nuova App CAME Access. Vuoi iniziare la procedura per trasferire i dati di impianto nella nuova App?";
and how set the text property of the UILabel:
messageLabel.text = NSLocalizedString("m_alert_message", comment: "")
messageLabel.lineBreakMode = .byWordWrapping
messageLabel.textAlignment = .center
messageLabel.numberOfLines = 0
messageLabel.font = UIFont(name: XipAppearance.fontName, size: XipAppearance.fontSizeText)
containerView.addSubview(messageLabel)
Another strange thing is all other texts in all other views are correctly loaded and showed.
Does anyone have any idea what the problem might be?