, usata per il debug delle applicazioni. Taking up the post from Actionscript to Objective-C (where you compare the code and syntax ActionScript and Objective-C), we have the convenient feature in ActionScript trace ( ) , used for debugging applications. This function outputs a console on the Adobe Flash development environment. It is mainly used for debugging and testing of "movie" / application. In XCode / Objective-C we have: NSLog ( ) . di Actionscript: The syntax of this function is very similar to the trace ( ) in Actionscript:
1 | "Sono una linea di debug" ) ; NSLog (@ "I am debugging a line"); |
In Actionscript we have:
1 | "Sono una linea di debug" ) ; trace ("I am debugging a line"); |
Apart from the use of the sign (@), as you can see, are identical. The differences (and similarities) start when you want to display values of variables, for example in Actionscript we have:
1 2 3 | "Coordinata x:" + x + " coordinata y:" + y ) ; trace ("x-coordinate:" + x + "y coordinate:" + y); / / Or "Coordinate: " , x , y ) ; trace ("Coordinates", x, y); |
In Objective-C we have:
1 | "Coordinata x:%i coordinata y:%i" , x, y ) ; NSLog (@ "x-coordinate: the y coordinate%% i", x, y); |
che opera sull'Apple System Log. Note:
NSLog()actually calls the more generic functionNSLogv ( )that operates on the implementa System Log. The functions are in fact identical, changing only the input parameters.
o sprintf ( ) . The developers will find very familiar with the C string formatting, as with printf ( ) or sprintf ( ) . For details, see String Format Specifiers .










There are no comments for this post
Leave a comment