On Tue, Aug 14, 2012 at 2:43 AM, Seth Willits <sli...@araelium.com> wrote:

>
> - (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString
> *)type
> {
>         if ([type isEqual:NSStringPboardType]) {
>                 if ([[pboard stringForType:type] isEqual:@"foo"]) {
>                         NSRange range = [self selectedRange];
>
>                         if ([self shouldChangeTextInRange:range
> replacementString:@"bar"]) {
>                                 [self replaceCharactersInRange:range
> withString:@"bar"];
>                         }
>
>                         return YES;
>                 }
>         }
>
>         return [super readSelectionFromPasteboard:pboard type:type];
> }
>
>
This works great, thanks a lot!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to