Dear programmers, So, I used the crop marker code that apple provides to experiment in creating a selecting rectangle. I first subclassed NsView as MWSelectingView, and everything worked like clock work. I was even able to modify the CropMarker object (MWViewSelectionMarker) so that when the window resizes it resizes as well.
I then just changed my MWSelectingView so it is a subclass of PDFView instead. No go. Now even before I can click on it, while it is loading from nib it bombs with the following pearls of wisdom. I can't find a discussion of cpSelections anywhere. I also don't get how come it even comes to call MWViewSelectionMarker. Only my subclass knows about it. Yes it calls it in drawRect, but really nowhere else. Thoughts? Any experience in subclassing PDFVIew to capture mouse downs? 2010-05-26 13:01:19.903 SelectedImage[1487:a0f] -[MWViewSelectionMarker cpSelections]: unrecognized selector sent to instance 0x102030480 2010-05-26 13:01:19.906 SelectedImage[1487:a0f] An uncaught exception was raised 2010-05-26 13:01:19.906 SelectedImage[1487:a0f] -[MWViewSelectionMarker cpSelections]: unrecognized selector sent to instance 0x102030480 2010-05-26 13:01:20.017 SelectedImage[1487:a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MWViewSelectionMarker cpSelections]: unrecognized selector sent to instance 0x102030480' *** Call stack at first throw: ( 0 CoreFoundation 0x00007fff88964d24 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00007fff8472e0f3 objc_exception_throw + 45 2 CoreFoundation 0x00007fff889be160 +[NSObject(NSObject) doesNotRecognizeSelector:] + 0 3 CoreFoundation 0x00007fff88936d3f ___forwarding___ + 751 4 CoreFoundation 0x00007fff88932e88 _CF_forwarding_prep_0 + 232 5 PDFKit 0x00007fff846576ee -[PDFView(PDFViewInternal) invalidateSelectionBounds:] + 54 6 PDFKit 0x00007fff8464c71a -[PDFView becomeFirstResponder] + 42 7 AppKit 0x00007fff856849b6 -[NSWindow makeFirstResponder:] + 643 8 AppKit 0x00007fff85684696 -[NSWindow _selectFirstKeyView] + 679 9 AppKit 0x00007fff856843cf -[NSWindow _setUpFirstResponderBeforeBecomingVisible] + 190 10 AppKit 0x00007fff85683773 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 986 11 AppKit 0x00007fff8568334a -[NSWindow orderWindow:relativeTo:] + 94 12 AppKit 0x00007fff8564f340 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1726 13 AppKit 0x00007fff8564d45d loadNib + 226 14 AppKit 0x00007fff8564c96d +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248 15 AppKit 0x00007fff8564c7a5 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326 16 AppKit 0x00007fff85649d27 NSApplicationMain + 279 17 SelectedImage 0x0000000100000e5d main + 33 18 SelectedImage 0x0000000100000e34 start + 52 ) terminate called after throwing an instance of 'NSException' Program received signal: “SIGABRT”. Matthew Weinstein Associate Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com