I want a input from user their name and output that input name in NSLog using NSString. I don't know which % sign and how to output that. Can i use scanf() function for that? Please help me , i am just beginner of Objective-C.
You can use %@ for all objects including NSString. This will in turn call the objects description method and print the appropriate string.
NSLog method in Objective-C prints out log messages.
In Swift with Xcode you can use either print() or NSLog() . print() just outputs your text.
You can use %@ for all objects including NSString. This will in turn call the objects description
method and print the appropriate string. Most objects have a rather useful representation already there (e.g. NSArray objects return the descriptions of all their contents).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With