views:

29

answers:

1

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 say something about NSInteger?

Thanks for answers! Dennis

+2  A: 

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

CGFloat imageWidth =  _classificationView.tag * 14.0;
Georg Fritzsche
yeah, that works. strange - i thought i used the tag property to save a string a while ago. but maybe that's not true.thank you!
denbec