Questions tagged [nonatomic]
The nonatomic tag has no usage guidance.
nonatomic
15
questions
1947
votes
28
answers
534k
views
What's the difference between the atomic and nonatomic attributes?
What do atomic and nonatomic mean in property declarations?
@property(nonatomic, retain) UITextField *userName;
@property(atomic, retain) UITextField *userName;
@property(retain) UITextField *...
11
votes
5
answers
8k
views
Will atomic operations block other threads?
I am trying to make "atomic vs non atomic" concept settled in my mind. My first problem is I could not find "real-life analogy" on that. Like customer/restaurant relationship over atomic operations or ...
10
votes
3
answers
6k
views
Objective-c properties for primitive types
In Objective-C Does it ever make sense to specify a property for a primitive type as nonatomic?
I'm wondering about the difference between these two properties:
@property (nonatomic) BOOL myBool;
@...
8
votes
1
answer
557
views
Atomic access to non-atomic memory location in C++11 and OpenMP?
OpenMP, in contrast to C++11, works with atomicity from a perspective of memory operations, not variables. That allows, e.g., to use atomic reads/writes for integers being stored in a vector with ...
7
votes
3
answers
2k
views
Objective-C: Defaults to atomic for scalar properties?
A friend told me that the @property default for scalar properties (BOOL, NSInteger, etc.) is nonatomic. I.e.,
@property BOOL followVenmo;
defaults to
@property (nonatomic) BOOL followVenmo;
But, I ...
5
votes
1
answer
69
views
How to remove function from list in R?
I have list with two functions:
foo <- function() { print('foo') }
bar <- function() {}
l <- list(foo, bar)
How can I remove function foo without knowing its index?
I've tried this (to get ...
5
votes
1
answer
470
views
Difference between private instance variable and property in class extension (Objective-c 2.0)
What are the differences (if any) between the following Objective-c 2.0 code snippets:
// in MyClass.h
@interface MyClass
@private
NSString *myString;
@end
and
// in MyClass.m
@interface ...
5
votes
1
answer
3k
views
Why atomic and nonatomic concept has removed from swift
There is no nonatomic keyword in swift, Why nonatomic not required in swift as it exist in objective c.
3
votes
5
answers
798
views
Dangers of simultaneous write and read of a boolean in a simple situation
I've read some similar questions but the situations described there are bit more complicated.
I have a bool b initialized as false in the heap and two threads. I do understand that operations with ...
2
votes
2
answers
1k
views
What is the difference between a strong and weak button in Objective c? [duplicate]
When declaring a button, there are always two options as properties for the button:strong and weak. What is the difference between them? Also, what it nonatomic? For example:
@property (weak, ...
0
votes
2
answers
64
views
Deallocating nonatomic copy setter
I am trying to create non-atomic copy accessors, and I read everywhere that the object should be released at the end. So, if you could help me understand whether I am doing it properly, I would ...
0
votes
1
answer
586
views
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 ...
0
votes
1
answer
798
views
are nonatomic and atomic thread unsafe in objective c?
I read that nonatomic and atomic both are thread unsafe. but nonatomic is faster because it allows faster access means asynchronously and atomic is slower it allows slower access synchronously.
0
votes
0
answers
84
views
C - volatile qualifier while lock is held
Do I need the volatile qualifier for variables only accessed while a lock is held? In this code, could removing the volatile qualifier from n possibly change the behavior when concurrent_foo is ...
0
votes
0
answers
21
views
What is the value of property in ios
In Atomic we all know one thread is access one object at a time. if we have 3 thread want to access one object then first come first serve method apply to thread ... but in non atomic all thread is ...