• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTableView subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView subclass


  • Subject: NSTableView subclass
  • From: Blake Hegerle <email@hidden>
  • Date: Tue, 10 Sep 2002 13:32:11 -0500

Hi,
I am using an NSTableView to display some data. I would like to be
able to select some rows in the table and drag them into various
applications. In my tableView:writeRows:toPasteboard: method, I put
them using the pasteboard as NSStringPboardType. That's not the
problem. Since I want to drag these to another application, I use a
special subclass of NSTableView to allow interapplication dragging.
This class looks like:

/* MyTableView */

#import <Cocoa/Cocoa.h>

@interface MyTableView : NSTableView
{
}

- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal;

@end

And the following implementation:

#import "MyTableView.h"

@implementation MyTableView

- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal {
if (isLocal) return NSDragOperationEvery;
else return NSDragOperationCopy;
}

@end

Now, I know this is getting instantiated (I broke into awakeFromNib:)
However, when I send the makeKeyAndOrderFront: message to the window
containing the custom view, I get a EXC_BAD_ACCESS. If I change the
custom class of the TableView back to NSTableView, every thing is fine,
but if it is a NSTableView, it crashes.

Here is a partial stack trace.

#0 0x9068ba54 in objc_msgSend ()
#1 0x907e2e14 in -[NSArray makeObjectsPerformSelector:withObject:] ()
#2 0x93360fd4 in -[NSView _windowChangedKeyState] ()
#3 0x907e2e14 in -[NSArray makeObjectsPerformSelector:withObject:] ()
#4 0x93360fd4 in -[NSView _windowChangedKeyState] ()
#5 0x907e2e14 in -[NSArray makeObjectsPerformSelector:withObject:] ()
#6 0x93360fd4 in -[NSView _windowChangedKeyState] ()
#7 0x907e2e14 in -[NSArray makeObjectsPerformSelector:withObject:] ()
#8 0x93360fd4 in -[NSView _windowChangedKeyState] ()
#9 0x931a23f0 in -[NSFrameView _windowChangedKeyState] ()
#10 0x9336ffbc in -[NSWindow _setFrameNeedsDisplay:] ()
#11 0x93371e3c in -[NSWindow makeKeyAndOrderFront:] ()
...snip...

Any help would be appreciated.

Blake Hegerle
Software Engineer
RiskWise L.L.C.
1010 West Saint Germain Street
Suite 150
St. Cloud, MN 56304
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Learning lex/yacc (was: Book- Building cocoa applications)
  • Next by Date: Re: Getting NSView mousedown event postion?
  • Previous by thread: Re: Learning lex/yacc (was: Book- Building cocoa applications)
  • Next by thread: Availability Macros question
  • Index(es):
    • Date
    • Thread