Post

Replies

Boosts

Views

Activity

Reply to App hangs when setting constraint to a very specific value (a width divided by 2).
This answer comes from Programming in Objective-C by Stephen Kochan, pg. 52-53, if you don't want to read that, here is the text and explanation from the book, with some commentary of my own, and since most of UIKit is written in Obj-C I surmise these limitations apply here as well Program 4.1 uses the basic Objective-C data types. Program 4.1 #import <Foundation/Foundation.h> int main (int argc, char * argv[]) { @autoreleasepool { int integerVar = 100; float floatingVar = 331.79; double doubleVar = 8.44e+11; char charVar = 'W'; NSLog (@"integerVar = %i", integerVar); NSLog (@"floatingVar = %f", floatingVar); NSLog (@"doubleVar = %e", doubleVar); NSLog (@"doubleVar = %g", doubleVar); NSLog (@"charVar = %c", charVar); } return 0; } Program 4.1 Output integerVar = 100 floatingVar = 331.790009 doubleVar = 8.440000e+11 doubleVar = 8.44e+11 charVar = W In the second line of the program’s output, notice that the value of 331.79 , which is assigned to floatingVar , is actually displayed as 331.790009 . The reason for this inaccuracy is the particular way in which numbers are internally represented inside the computer. You have probably come across the same type of inaccuracy when dealing with numbers on your calculator. If you divide 1 by 3 on your calculator, you get the result .33333333, with perhaps some additional 3s tacked on at the end. The string of 3s is the calculator’s approximation to one third. Theoretically, there should be an infinite number of 3s. But the calculator can hold only so many digits, thus the inherent inaccuracy of the machine. The same type of inaccuracy applies here: Certain floating-point values cannot be exactly represented inside the computer’s memory. If by any chance you know PHP, this ties in with PHP_FLOAT_EPSILON. So in a nutshell, the computer enters into an infinite loop when you try to divide by 2 because it does not have an exact value for your constraint, which it is trying to calculate with its inherent precision limitation without success, and the low-level raw data type implementation demands that it have an exact value before program execution continues. Hope this helps
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’22
Reply to Xcode 13 "Missing package product" using local Swift Packages
what worked for me was re-adding each and every single package i had
Replies
Boosts
Views
Activity
Mar ’25
Reply to Xcode 13 "Missing package product" using local Swift Packages
In my case, the error occurred because for one of my packages, they moved from using the master branch nomenclature to the main branch nomenclature, and in my project, it was set to the master branch. Changing this fixed all my outstanding issues. Xcode 14.2
Replies
Boosts
Views
Activity
Jan ’24
Reply to Potential bug with "Unable to activate constraint with anchors"
Am having a similar issue, and I lean towards thinking it's a bug
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to "error: using bridging headers with module interfaces is unsupported" when attempting to run the sample MerchantCheckoutApp from MasterPass docs
MasterPass Docs and related downloadable zip with sample code referred to here can be found here https://developer.mastercard.com/masterpass-merchant-integration-v7/documentation/mobile-integration/masterpass-checkout-ios-sdk-v28/
Replies
Boosts
Views
Activity
Mar ’23
Reply to UIKit Alerts in SwiftUI
Similar problem here. Doesn't seem to be much material on this. Guess we're on our own
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to objc[6125]: Class _PathPoint is implemented in both ...
same issue. Guess I'll just have to ignore it for now
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to BoringSSL debug error xcode 9 ios 11 swift4
Same issue here. StackOverflow answers to this only show how to hide the log messages, and that is not feasible
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to What causes this error? [UIFocus] Failed to update focus with context
Same issue here, Xcode 13.3. My UI stops responding on all iPads
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to App Store Approval
Thanks for clearing things up
Replies
Boosts
Views
Activity
Apr ’22
Reply to Xcode preference "highlight instances of selected symbol" not working
I have the same question
Replies
Boosts
Views
Activity
Feb ’22
Reply to App hangs when setting constraint to a very specific value (a width divided by 2).
This answer comes from Programming in Objective-C by Stephen Kochan, pg. 52-53, if you don't want to read that, here is the text and explanation from the book, with some commentary of my own, and since most of UIKit is written in Obj-C I surmise these limitations apply here as well Program 4.1 uses the basic Objective-C data types. Program 4.1 #import <Foundation/Foundation.h> int main (int argc, char * argv[]) { @autoreleasepool { int integerVar = 100; float floatingVar = 331.79; double doubleVar = 8.44e+11; char charVar = 'W'; NSLog (@"integerVar = %i", integerVar); NSLog (@"floatingVar = %f", floatingVar); NSLog (@"doubleVar = %e", doubleVar); NSLog (@"doubleVar = %g", doubleVar); NSLog (@"charVar = %c", charVar); } return 0; } Program 4.1 Output integerVar = 100 floatingVar = 331.790009 doubleVar = 8.440000e+11 doubleVar = 8.44e+11 charVar = W In the second line of the program’s output, notice that the value of 331.79 , which is assigned to floatingVar , is actually displayed as 331.790009 . The reason for this inaccuracy is the particular way in which numbers are internally represented inside the computer. You have probably come across the same type of inaccuracy when dealing with numbers on your calculator. If you divide 1 by 3 on your calculator, you get the result .33333333, with perhaps some additional 3s tacked on at the end. The string of 3s is the calculator’s approximation to one third. Theoretically, there should be an infinite number of 3s. But the calculator can hold only so many digits, thus the inherent inaccuracy of the machine. The same type of inaccuracy applies here: Certain floating-point values cannot be exactly represented inside the computer’s memory. If by any chance you know PHP, this ties in with PHP_FLOAT_EPSILON. So in a nutshell, the computer enters into an infinite loop when you try to divide by 2 because it does not have an exact value for your constraint, which it is trying to calculate with its inherent precision limitation without success, and the low-level raw data type implementation demands that it have an exact value before program execution continues. Hope this helps
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’22