0

The snippet of code:

NSUInteger *lengthOfLine =100;
NSUInteger *half = lengthOfLine/2;

The compile error for line 2:

Invalid operands to binary expression ('NSUInteger *' (aka 'unsigned long *') and 'int')
rmaddy
  • 314,917
  • 42
  • 532
  • 579
learner
  • 11,490
  • 26
  • 97
  • 169

1 Answers1

1

you should use NSUInteger, not NSUInteger *. NSUInteger is a primitive type, not a subclass of NSObject. Now you're dealing with a pointer to NSUInteger

Andrey Chernukha
  • 21,488
  • 17
  • 97
  • 161