I am using Objective-C++. Can I create a property of C++ class type?
I tried but it reports must be inherited from NSObject
.
You can, but it cannot be a strong or weak reference (if you need that, look up std::shared_ptr
and std::weak_ptr
).
class C {};
@interface D
@property(nonatomic, assign) C p;
@end