Hi, does K/N expect all the properties of a class ...
# kotlin-native
l
Hi, does K/N expect all the properties of a class to be nonatomic? Lets say I have this interface in K/N:
Copy code
interface SomeInterface {
    var aProperty: String
}
the generated ObjC interface would be
Copy code
@protocol AIKSomeInterface
@required
@property NSString* aProperty;
@end;
and implementing it, with setters and getters in ObjC is not allowed because it’s seen as
atomic
, if my class declares the property as
@property (nonatomic) NSString* aProperty;
then it shows warnings that atomicity is not the same as in protocol. can we ignore it for now or better just to use functions for getters and setters instead of properties ?
s
Hi. I can’t reproduce this:
and implementing it, with setters and getters in ObjC is not allowed because it’s seen as
atomic
,
What warning or error does the compiler report? Could you please provide any sample? As for atomic and nonatomic when overriding, you can safely ignore this warning for now.
l
Thanks a lot Svyatoslav. I’m puzzled now because I also can’t reproduce it anymore. I guess I did something wrong 😐 I just removed the
nonatomic
and it seems to work .
s
Thank you, I’m glad to know this 🙂