Re: Getting clipboard text contents
Re: Getting clipboard text contents
- Subject: Re: Getting clipboard text contents
- From: The Karl Adam <email@hidden>
- Date: Sun, 16 Jan 2005 03:31:08 -0500
Then your doing it wrong, if you merely want to read the pasteboard,
you ask it for it's declaredTypes then you read the type your
interested in. -declareTypes: clears the pasteboard since it assumes
your going to put new stuff there. What you want to do instead is just
directly access -stringForType:NSStringPboardType or check that it's
declated then access it.
-Karl
On Sun, 16 Jan 2005 03:09:20 -0500, Austin Sarner <email@hidden> wrote:
> Yes, but it assumes the user has something on the pasteboard.. the
> purpose of the code is to retrieve whatever the user already has.
> Thanks for the response.
>
> On Jan 16, 2005, at 2:22 AM, The Karl Adam wrote:
>
> > You declared teh types your going to put on the pasteboard, but from
> > this code you never actually put anything on the pasteboard.
> >
> > -Karl
> >
> > On Sat, 15 Jan 2005 23:19:41 -0800, Austin Sarner
> > <email@hidden> wrote:
> >> After reading through the docs and writing a working clipboard text
> >> setting method, I'm not exactly sure why the below does not work. It
> >> simply does not return the clipboard contents. Thanks a bunch for
> >> any nudge in the right direction.
> >>
> >> NSPasteboard *thePasteboard = [NSPasteboard generalPasteboard];
> >> NSMutableArray * types = [[NSMutableArray alloc] init];
> >> int i;
> >> [types addObject:NSStringPboardType];
> >> i = [thePasteboard declareTypes:types owner:nil];
> >> NSLog([thePasteboard stringForType:NSStringPboardType]);
> >> _______________________________________________
> >> Do not post admin requests to the list. They will be ignored.
> >> Cocoa-dev mailing list (email@hidden)
> >> Help/Unsubscribe/Update your Subscription:
> >>
> >> This email sent to email@hidden
> >>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden