Here’s how I do it:
BOOL flag = YES;
NSLog(flag ? @"Yes" : @"No");
?:
is the ternary conditional operator of the form:
condition ? result_if_true : result_if_false
Substitute actual log strings accordingly where appropriate.
More Related Contents:
- Setting a button’s target/action and passing a particular string to the action [closed]
- How to programmatically send SMS on the iPhone?
- Proper way to exit iPhone application?
- Getting current device language in iOS?
- How do I create a basic UIButton programmatically?
- Placeholder in UITextView
- Why NSUserDefaults failed to save NSMutableDictionary in iOS?
- How do I wrap text in a UITableViewCell without a custom cell
- Hide separator line on one UITableViewCell
- How do I make UILabel display outlined text?
- Fade/dissolve when changing UIImageView’s image
- How to disable/enable the return key in a UITextField?
- How do I scroll the UIScrollView when the keyboard appears?
- in iPhone App How to detect the screen resolution of the device
- Center content of UIScrollView when smaller
- Detecting whether or not device support phone calls?
- Can I get a NSURL from an XCAssets bundle?
- How to detect iphone is on silent mode
- How to change UINavigationBar background color from the AppDelegate
- How to specify size for iPhone 6/7 customised edge-to-edge image?
- Cocoa-Touch: How do I see if two NSDates are in the same day?
- How can I delay a method call for 1 second?
- AVAudioPlayer throws breakpoint in debug mode
- Getting the Value of a UITextField as keystrokes are entered?
- Setting scroll position in UITableView
- rotate a UIView around its center but several times
- UITextView cursor below frame when changing frame
- What does the NS prefix mean?
- How do I disable a UIButton?
- Decrease the width of the last line in multiline UILabel