开发者

Does Objective-C support C# style attributes?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜