How do you print something to the console of Xcode
, and is it possible to view the Xcode
console from the app itself?
Thanks!
How to print:
NSLog(@"Something To Print");
Or
NSString * someString = @"Something To Print";
NSLog(@"%@", someString);
For other types of variables, use:
NSLog(@"%@", someObject);
NSLog(@"%i", someInt);
NSLog(@"%f", someFloat);
/// etc...
Can you show it in phone?
Not by default, but you could set up a display to show you.
print("Print this string")
print("Print this \(variable)")
print("Print this ", variable)
print(variable)