code_junkie

How do I convert a float to an int in Objective C?

Nov 12th, 2011
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int myInt = (int) myFloat;
  2.  
  3. int myInt = myFloat;
  4.  
  5. int myInt = [[NSNumber numberWithFloat:0.883f] intValue];
  6.  
  7. int myInt = (int) myFloat;
  8.  
  9. int myInt = [[NSNumber numberWithFloat:0.883f] intValue];
Add Comment
Please, Sign In to add comment