我有一个名为 CardView 的 UIView 子类,并创建了一个像这样的实例:
CardView *newCard = [[CardView alloc] initWithFrame:CGRectMake(x,y,w,h)];
然后我尝试像这样设置视图的标签:
newCard.tag = 1;
但这似乎并没有真正为该视图设置标签。如果我在那里设置一个断点,然后做
po newCard.tag
在调试器中,它说
error: property 'tag' not found on object of type 'CardView *'
我不应该将标签属性作为 UIView 子类的一部分吗?