开发者

Does Objective-C support C# style attributes?

开发者 https://www.devze.com 2023-04-11 00:47 出处:网络
Does Objective-C support marking properties/methods with attributes? like so: #MyAt开发者_开发百科tribute //sudo example

Does Objective-C support marking properties/methods with attributes? like so:

#MyAt开发者_开发百科tribute //sudo example
@porperty (nonatomic, retain) NSString * myString;

I would then like to "reflect" over the class and determine what attribute is attached to the property "myString".

Is something like this possible?

Thanks


No, there are no attributes in Objective-C. You do get a form of reflection, you can test an instance to see if it exists in the instance, but that is all you get.

0

精彩评论

暂无评论...
验证码 换一张
取 消