Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatthew Chess
13,860 PointsDeclare a pointer vs an int?
In this video they write...
NSArray *_center;
float _radius
Why do you user a pointer to center for NSArray but float for the variable radius?
2 Answers
banned banned
Courses Plus Student 11,243 PointsIn Objective-C the only way you can get to an Object is through a pointer. So:
NSArray *myArrayOne = [NSArray arrayWithObjects: @"One",@"Two",@"Three",nil];
NSArray *myArrayTwo = myArrayOne;
myArrayOne = nil;
Matthew Chess
13,860 PointsSo for primitive data types I can just pass a value into the variable but for objects they need a pointer?
It would be illegal to write...?
NSNumber one = @1;