NSPasteboard (EDExtensions)


Declared In:
NSPasteboard+Extensions.h


Category Description

Various useful extensions to NSPasteboard.


Method Types

Typecheck
- containsType:
Handling objects
- setObject:forType:
- objectForType:
Handling references
- setObjectByReference:forType:
- objectByReferenceForType:

Instance Methods

containsType:

- (BOOL)containsType:(NSString *)type

Returns YES if type is one of the types available on the pasteboard.


objectByReferenceForType:

- (id)objectByReferenceForType:(NSString *)pboardType

Returns the object stored by reference on the pasteboard. This method can return invalid object references as it does not (and cannot) ensure the corresponding object has not been deallocated while the reference was on the pasteboard.


objectForType:

- (id)objectForType:(NSString *)pboardType

Unarchives the object stored with the type specified using the standard NSUnarchiver. This effectively copies the original object.


setObject:forType:

- (void)setObject:(id)object forType:(NSString *)pboardType

Archives the object using the standard NSArchiver and stores it with the type specified.


setObjectByReference:forType:

- (void)setObjectByReference:(id)object forType:(NSString *)pboardType

Saves a reference to the object on the pasteboard. This is in form of a pointer and, hence, can only be used in the same process space. Note also, that the object must be retained externally until its reference is removed from the pasteboard.


Version 2.0 Copyright ©2002. All Rights Reserved.