Sometimes you want to get the whole part of a mixed number, for example:
1.66
What if you just want the “1″ part?
In Actionscript:
var wholeNumber:int; var example:Number = 1.66 wholeNumber = int(example);
In Objective-C:
int wholeNumber; float example; float = 1.66; wholeNumber = (int)(example);
In Actionscript 3, you write destroy() methods to clear up anything you’re not using:
public function destroy():void
{
removeChild(things-I-put-onto-the-stage);
things-I-put-onto-the-stage = null;
variables-I-created-in-this-class = null;
}
However, in Objective-C, you deallocate memory for anything you created when the class was instantiated:
- (void)dealloc {
[variables-I-created-in-this-class release];
[super dealloc];
}