perfromDragOperation:


#1

I have Bold and Italics drop shadow and dynamic Resizing left on which has given me much grief.
wondering if that is why in Dragging-Destination section

-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender { NSPasteboard *pb = [sender draggingPasteboard]; if (![self readFromPasteBoard:pb]) { NSLog(@"Error: could not read from dragging pasteboard"); return NO; } return YES; }

had to switch to if ([self readFromPasteBoard:pb]) { ...

to make it work properly. Or is it something else?

thanks
Ian


#2

[quote=“IanDMah”]I have Bold and Italics drop shadow and dynamic Resizing left on which has given me much grief.
wondering if that is why in Dragging-Destination section

-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender { NSPasteboard *pb = [sender draggingPasteboard]; if (![self readFromPasteBoard:pb]) { NSLog(@"Error: could not read from dragging pasteboard"); return NO; } return YES; }

had to switch to if ([self readFromPasteBoard:pb]) { ...

to make it work properly. Or is it something else?

thanks
Ian[/quote]

It’s something else :slight_smile:

you have a typo in there, it should read

	if (![self readFromPasteboard:pb]) {

(Note it’s Pasteboard and not PasteBoard)

Xcode should have given you a warning though, like “warning: ‘BigLetterView’ may not respond to ‘-readFromPasteBoard:’”


#3

Actually more distinctly:

doesn’t work properly
and

does…
shrug.
wacky hun?

thanks
Ian

ps. no errors or warnings either.


#4

[quote=“IanDMah”]Actually more distinctly:

doesn’t work properly
and

does…
shrug.
wacky hun?

thanks
Ian

ps. no errors or warnings either.[/quote]

Ok, my fault, I just copy’n pasted your code into my Project and got this error… I realized later that we were supposed to write the readFromPasteboard-method… so… you can call it anyway you want ofc, anway I’d check the readFromPaste{b,B}oard-method in BigLetterView.m (see page 296) (I’m pretty sure you just mixed both returns up) :slight_smile: