Hi there. I've got some code that gives me NSValue's, but I want to get a float out of them. I can't see how to do it. I see how to put different types into an NSValue, but I can't see how to get them out by type. Anyone? Thanks.
How to convert NSValue to float or int?
(3 posts) (2 voices)-
Posted 1 month ago #
-
Do you need to use NSValue? cause I think what you are looking is NSNumber, which lets you encapsulate int, floats, etc. Or if its NSValue, and you are maybe using the valueWithPointer, then just cast.
Posted 1 month ago # -
That totally makes sense! I guess I'm just so used to convenience methods I forgot about simply casting it. thanks!
Posted 1 month ago #
Reply
You must log in to post.