简体   繁体   中英

Do I have to use nonatomic property in objective-c ios programing?

I'm developing an iPhone app.

All the iPhone development books I have read use nonatomic property.
And IBOutlets which xcode generates also use nonatomic keyword.

But I don't like to write nonatomic on every property because it decrease readability too much.

Are there any problem if I do not use nonatomic keyword for all properties?

If nonatomic keyword makes my app only a little bit faster, I want to delete all nonatomic keywords.
Is it good idea?

If you delete nonatomic from property then by default all your properties will be 'atomic'. If there are a lot of 'atomic' properties without purpose then it will slow up your app, because at compile time atomic properties generate a complex code and every time you use that property that code will be executed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM