How to access the Pasteboard?
How to access the Pasteboard?
- Subject: How to access the Pasteboard?
- From: "Frederick C. Lee" <email@hidden>
- Date: Sun, 4 Apr 2004 16:00:05 -0700
Greetings:
I've done a cut/paste of the following routine from a working example:
//
------------------------------------------------------------------------
----------
// The following routine is needed to get data from the pasteboard.
- (void)lookupFromPB:(NSPasteboard *)pb
userData:(void *)contextData
error:(NSString **)error
{
NSLog(@"Inside lookupFromPB.");
NSArray *types = [pb types];
NSString *pboardString;
if (![types containsObject:NSStringPboardType]) {
*error = @"No string on pasteboard";
return;
}
pboardString = [pb stringForType:NSStringPboardType];
if (!pboardString) {
*error = @"String on pasteboard is null";
return;
}
[AreaCode_Field setStringValue:pboardString];
}
//
------------------------------------------------------------------------
-------------
1) The working example works.
2) My copy doesn't. I can't get any NSLog message.
3) I have the delegates working:
//
------------------------------------------------------------------------
-
- (void)applicationDidFinishLaunching:(NSNotification *)note
{
NSLog(@"Hello from applicationDidFinishLaunching.");
[NSApp setServicesProvider:self];
}
//
------------------------------------------------------------------------
--------
4) But 'lookupFromPB' doesn't fire!
========
Question:
1) Where does 'lookupFromPB' come from? I did a global search of the
foundation to find nothing, yet it compiles.
2) How can it get it to fire up?
Thanks in advance!
Ric.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.