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 trial
Why is NSLog called like a C method rather than an Obj-C method?
So NSLog is a method that writes to the console. But when we call it, we say
NSLog(@"Blah Blah Blah");
[NSLog @"Blah Blah Blah"];
Any reason behind this? Or is the second way possible to do? The question is kinda stupid, but it's really bugging me as to why we do it this way...
Michael Hulet47,911 Points
We call it like a C function because it is a C function, not a method. A method is tied to a specific class, where
NSLog is not