I should add-- this makes me so scared to release my application because
there could be countless places where numbers are accidentally getting
turned to 0 when they shouldn't be as CGFloat is used all over the
place.

And also I should say this behavior does NOT happen on any other of my
apple devices, only the iPad pro.

Patrick J. Collins
http://collinatorstudios.com


On Mon, 17 Oct 2016, Patrick J. Collins wrote:

> I just got an iPad pro over the weekend to make sure my app worked on
> it, and sure enough, it didn't...  After spending a ton of time
> debugging, I finally figured out what the deal is, and honestly, I do
> not understand it at all.  Here is the problem:
>
>
>   (lldb) expr (float)[self.fireable laserXOffset]
>   (float) $11 = 0
>   (lldb) expr (CGFloat)[self.fireable laserXOffset]
>   (CGFloat) $12 = 400
>
> ????
>
> Why in the world is it so picky that casting a CGFloat as a float will return 
> a 0 value?  That just seems like insanity.
>
> I see this:
>
> #if defined(__LP64__) && __LP64__
> # define CGFLOAT_TYPE double
> # define CGFLOAT_IS_DOUBLE 1
> # define CGFLOAT_MIN DBL_MIN
> # define CGFLOAT_MAX DBL_MAX
> #else
> # define CGFLOAT_TYPE float
> # define CGFLOAT_IS_DOUBLE 0
> # define CGFLOAT_MIN FLT_MIN
> # define CGFLOAT_MAX FLT_MAX
> #endif
>
> Yet if I do:
>
>   (lldb) expr (double)[self.fireable laserXOffset]
>   (double) $15 = 400
>
> So........  CGFloat is a float, yet it returns 0??????????? WTF?
>
> Patrick J. Collins
> http://collinatorstudios.com
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (Objc-language@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to