• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to access the Pasteboard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: How to access the Pasteboard?
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Pointy Menu Like in Dock
  • Next by Date: Re: Pointy Menu Like in Dock
  • Previous by thread: Re: Pointy Menu Like in Dock
  • Next by thread: Re: How to access the Pasteboard?
  • Index(es):
    • Date
    • Thread