How to use a boolean property in objective C class, i did it like:
@property (nonatomic, copy) BOOL *locationUseBool;
but it gives error that:
Property with ‘copy’ attribute must be of object type.
what is the correct way of declaring?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can declare this way also.
Basically, if you say nonatomic, and you generate the accessors using @synthesize, then if multiple threads try to change/read the property at once, badness can happen. You can get partially-written values or over-released/retained objects
In a multi-threaded program, an atomic operation cannot be interrupted partially through, whereas nonatomic operations can.