About pointers in Objective-C

I stumbled upon the following and cannot understand why this works. Please explain why I do not need to use a pointer before range?

NSString *d = @"The quick brown fox";
NSRange range = [d rangeOfString:@"brown"];
+5
source share
1 answer

NSString- Object type. All types of objects are pointers and cannot be created on the stack. NSRangeis a C-structure. Structures can be created on the stack and, therefore, not all pointers are necessary.

There is no good guide to find out which of them are objects and which are structures. You just need to check each type as you move forward.

+9
source

All Articles