开发者

Why do I get "Invalid receiver type 'NSInteger'"?

Probably a simple question: Why do I get an compiler warning for the following objective-C code?

//_classificationView.tag is a NSString

CGFloat imageWidth =  [_classificationView.tag floatValue] * 14.0;

And why does it开发者_C百科 say something about NSInteger?

Thanks for answers! Dennis


Because the tag property is a NSInteger and not a class type. Just use the following instead:

CGFloat imageWidth =  _classificationView.tag * 14.0;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜