NSUInteger error

I do not understand why an error occurs, the type of the returned message is the same, and Xcode swears.

Please tell me why?

  • it also says everything in error - the function should return NSUInteger *, and you return NSUInteger - Max Mikheyenko

1 answer 1

Probably you are used to putting an asterisk on the return type of the method. So objects are transferred to ObjC:

- (NSTimer*) makeTimer; 

This is because you need to pass the адрес object, since there is only one necessary instance of the class in memory. But for the return of primitive types of links are not needed, in most cases it is more problematic than useful. Therefore, in such cases you need to pass the value itself:

 - (NSUInteger) calculateSmth; 
  • AivanF. Thanks for the detailed answer! overlooked that no object is returned. - Dubplate