• 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
Re: Adding methods to dataSource
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding methods to dataSource


  • Subject: Re: Adding methods to dataSource
  • From: Björn Carlström <email@hidden>
  • Date: Fri, 2 Jul 2004 23:39:32 +0200

Thank you

I've just created my first informal protocol. It worked like a charm!


2004-07-02 kl. 20.02 skrev Chris Hanson:

On Jul 1, 2004, at 11:49 PM, Bjvrn Carlstrvm wrote:
I'm subclassing NSOutlineView to add the possibility to delete rows through the delete key. How do I add a new method (deleteItem:) to the NSOutlineViewDataSource. Just calling it works of course but I get a warning that the method might not exist. Do I subclass the NSOutlineViewDataSource somehow ?

Just declare a new informal protocol with a name like MyOutlineViewDataSource that includes a declaration for your deleteItem: method:

@interface NSObject (MyOutlineViewDataSource)
- (void)deleteItem:(id)item;
@end

Informal protocols are really useful for this kind of thing.

-- Chris

--
Chris Hanson <email@hidden>
http://www.livejournal.com/users/chanson/
_______________________________________________
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.
_______________________________________________
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.


References: 
 >Adding methods to dataSource (From: Björn Carlström <email@hidden>)
 >Re: Adding methods to dataSource (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Draggable Tags?
  • Next by Date: Re: [GENERAL] COPY command with blank incoming values
  • Previous by thread: Re: Adding methods to dataSource
  • Next by thread: Re: [GENERAL] COPY command with blank incoming values
  • Index(es):
    • Date
    • Thread