On Thu, Feb 28, 2008 at 11:32 AM, Vince <[EMAIL PROTECTED]> wrote: > Hi, > > My NSTextView has strange behavior when pasting: The rich text is > pasted as plain text when the material has been copied from Safari. > When the same material has been copied from another NSTextView (e.g., > TextEdit), it pastes properly as RTF.
What are the options set on your NSTextView in IB? It needs to be rich-text editable. > I checked my pasteboard type at the end of the > windowControllerDidLoadNib routine: > > NSArray *arrDrag = [tView acceptableDragTypes]; > for(i=0;i<[arrDrag count];i++) > NSLog(@"%@", [arrDrag objectAtIndex:i]); Dunno if this was a quick & dirty debug attempt or whatnot, but there are two style issues I'd like to highlight just as a note: 1) NSArray overrides -description to provide a reasonable string representation of its contents, so if you call NSLog(@"%@", arrDrag) things will Just Work(TM). 2) If you need something a bit fancier, instead of using the standard for-loop array idiom, it's recommended that you use an enumerator. If you're targeting 10.4, use NSEnumerator. If you're targeting 10.5, you can instead use the new for(foo in bar) syntax to take advantage of fast enumeration. HTH, --Kyle Sluder _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
