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
Do I need to know NS/Cocoa stuff for this course?
When Pasan talking about NS Dictionary and Swift Dictionary, I googled NS because I had no idea what that was.
Then I found an answer on StackOverflow: http://stackoverflow.com/questions/473758/what-does-the-ns-prefix-mean
I have no background in Objective-C/Cocoa/Swift, so I am a little overwhelmed to know that there are a lot more NS stuff and they are probably very important.
Do I need to know NS/Cocoa? Are they relevant for foreseeable future? How/where can I learn them for iOS development?
Pasan PremaratneTreehouse Teacher
You're quite ahead of the curve here :) The NS legacy is quite important and our plan is to teach it as we go along. That's a ways away though so here's a summarized intro:
NS comes from NeXT*S*tep, an operating system that Apple purchased back in the day and folded into their products. The underlying frameworks that we use to build Mac and iOS apps are known as Cocoa and Cocoa Touch respectively and are built on top of the NeXTStep Foundation and AppKit libraries.
Objective-C, the other language for iOS development, and the language that NeXTStep is built in, is built on top of the C language. So when the NeXTStep engineers were creating the base classes for Cocoa/Cocoa Touch, they needed to add a unique prefix to the objects they created so that it wouldn't conflict with C or Objective-C objects; they chose to add the NS prefix. So that's where NS comes from.
Cocoa and Cocoa Touch, the underlying frameworks for Mac/iOS development, are built in Objective-C, so even though we use Swift to write apps, we're using the same underlying framework and end up using Objective-C objects. Apple has done some work under the hood so that your Swift code works automagically-ish with the Objective-C objects so you don't have to worry about writing any Objective-C code for now.
To answer your questions:
Yes, you need to know about Cocoa and it's classes. I'll teach you what you need to know in each course though and eventually, we'll start writing some Objective-C code as well. If you want to get started immediately, we have a separate track - iOS Development with Objective-C that mirrors the Swift track so you can learn in either language.
Cocoa and thereby all the NS classes are extremely relevant since iOS is built on top of it. There are some interesting opinions out there about its longevity but it's too early to comment on those things really. For now, Cocoa is all we have.
If you want to know the ins and outs, I'd recommend starting with the Objective-C track and then making your way over to Swift when you're comfortable. All the code out there related to iOS development, whether it's blog posts, 3rd party libraries, etc, are almost all in Objective-C so you will certainly have more resources to fall back on.
Hope this helps.