Bad Receiver type 'NSInteger' (aka 'int')
11,383
Solution 1
int thumbCount = [self thumbsViewNumberOfThumbs:_totalThumbs];
Solution 2
The compiler is right: NSInteger
is not a type that could possibly have methods, because it is not an id
-derived type.
If you have a method that takes NSInteger
as parameter, you pass it after the colon :
, not as the receiver of the method.
Author by
icodes
Updated on June 26, 2022Comments
-
icodes about 2 years
int thumbCount = [_totalThumbs thumbsViewNumberOfThumbs:self];
- _totalThumbs is a NSInteger type property.
- thumbsViewNumberOfThumbs is a method of type NSInteger.
I need to get the count in 'int' itself so that i can use it for further calculations. Any suggestions?