Does Xcode 4.5.2 automatically prefix synthesized BOOL getters with is
I just noticed that I had a BOOL declared as
@property (nonatomic, assign) BOOL userAuthorized; and I was about to write my own getter for it and automatically Xcode autocompleted with
So I suspect it’s not necessary anymore to write
@property (nonatomic, assign, getter = isUserAuthorized) BOOL userAuthorized; ?
- Default value of BOOL
- App States with BOOL flags
- How to set a boolean type property in objective C class
- Need help saving bool to NSUserDefaults and using it in a if statement using Swift
- Objective C Boolean Array
- Swift 4: Printing out Bool optionals as either unwrapped true or false or as wrapped nil?
2 Solutions Collect From Internet About “Does Xcode 4.5.2 automatically prefix synthesized BOOL getters with is”
Apparently if you provide your own implementation of the
BOOL getter, the compiler is smart enough to figure out that
isActive is the getter for the
Nonetheless if you synthesize the getter you still have to provide
getter=isActive in order to use that signature for the getter instead of
Yes, you don’t need to write
getter = isUserAuthorized in property when you explicitly mention the getter of
BOOL property and you also don’t need to synthesize properties as xcode automatically do it for you.
- Swift function works in app but not within override func viewDidLoad()
- How to loop through JSON with SwiftyJSON?
- Objective-C: What's the difference between NULL, nil and @“”?
- What's the difference between the method signature and the selector in Objective-C?
- Passing Data Between View Controllers DidSelectRowsAtIndexPath Storyboards
- VectorKit crash reports with MKMapSnapshotter on iOS
- Detect the name of wireless network
- Objective-C categories: Can I add a property for a method not in my category?
- How do I concatenate strings in Swift?
- Can you share data on CloudKit between different apps
- How to determine height of UICollectionView with FlowLayout
- disable viewport zooming iOS 10+ safari?
- How do I set up an OpenGL project using XCode 4.2 in C++?
- Simulate Launch Options
- Using a custom image for a UITableViewCell's accessoryView and having it respond to UITableViewDelegate