قالب وردپرس درنا توس
Home / IOS Development / Why can the answer come back as Double or Float: iOSProgramming

Why can the answer come back as Double or Float: iOSProgramming


This may be a somewhat random problem, but I have tried to think it through. I'm new to iOS

Context: I started looking at the company's iOS app that hasn't been updated for over a year. I got the code for the app and couldn't compile. I had to update some packages like Sourcery and DateToolsSwift. A package was updated, but there is a video player package that is not directly related to the problem I have. I made these updates and was finally able to compile my code and get a simulator app running in xcode. Now I use the app in xcode and I get into a type of wrong situation where the json response from a call was viewed as a double, while the existing code supported a Float.

Running the same set of steps on the app from the store does not have an error.

I'm very confused about how my updates above have affected how an answer was written, and I hope someone might shed some light on other opportunities.

If there is any other factor that I do not think of as the Xcode version (10.2.1 at the moment against what the original app developer used 9.1) or the Swift version (4).

Any thoughts would be good. I'm confused and will find out why. I could only accept that something changed, but I would not run into more situations like this out of nowhere. It took me a while to go through this code to find out where the exact error was since it did not go over as a typo, and the answer was a nested json response needed to map different objects.

Thank you

Source link