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

iOS Build a Weather App with Swift Interacting with Data From the Web Constructing a URL

Tony Brackins
Tony Brackins
28,766 Points

NSURL

Why are we using NSURL for a string to a URL? Can't we just make it a plain string? Also, what's "NS" mean? I know we've been using it frequently.

1 Answer

Tony, NS is an acronym for NextStep.

NSURL is a class from which you can create NSURL objects. Here's the Apple documentation: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/

Yes, the URLs we are accustomed to are String objects. But NSURLs are not. Why? Mainly because NSURL objects have properties and methods Strings don't.