NSURL Additions Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.0 and later.
Declared in
NSPasteboard.h

Overview

The Application Kit extends Foundation’s NSURL class by adding support for pasteboards. NSWorkspace provides openURL: to open a location specified by a URL.

Tasks

Working with Pasteboards

Class Methods

URLFromPasteboard:

Reads an NSURL object off of pasteboard. Returns nil if pasteboard does not contain data of type NSURLPboardType.

+ (NSURL *)URLFromPasteboard:(NSPasteboard *)pasteboard
Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
NSPasteboard.h

Instance Methods

writeToPasteboard:

Writes the receiver to pasteboard. You must declare an NSURLPboardType data type for pasteboard before invoking this method; otherwise it returns without doing anything.

- (void)writeToPasteboard:(NSPasteboard *)pasteboard
Availability
  • Available in OS X v10.0 and later.
Related Sample Code
  • With and Without Bindings
Declared In
NSPasteboard.h