• 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: OutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OutlineView


  • Subject: Re: OutlineView
  • From: Anthony Cheung <email@hidden>
  • Date: Wed, 5 Mar 2003 18:24:50 +0800

Dear Joar,

Thanks for your reply. In my last email, I forgot to mention that I
have also implemented two delegate methods which are
- (BOOL)outlineView:(NSOutlineView *)olv shouldExpandItem:(id)item;
- (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell *)cell
forTableColumn:(NSTableColumn *)tableColumn item:(id)item;

In the awakeFromNib, that is what I do
- (void)awakeFromNib {
NSTableColumn *tableColumn = nil;
ImageAndTextCell *imageAndTextCell = nil;

tableColumn = [outlineView tableColumnWithIdentifier:
FIRST_COLUMN_ID];
imageAndTextCell = [[[ImageAndTextCell alloc] init] autorelease];
[imageAndTextCell setEditable: YES];
[tableColumn setDataCell:imageAndTextCell];

[outlineView registerForDraggedTypes:[NSArray
arrayWithObjects:DragDropSimplePboardType, NSStringPboardType,
NSFilenamesPboardType, nil]];
}

I am not sure what you mean "reverse" springs. What I did is
"Control-drag" from my controller to outline view and connect to my
outline for NSOutlineView. In addition, what else do I need in
awakeFromNib?

Thanks for your help in advance.

Regards,

Anthony

On Wednesday, Mar 5, 2003, at 17:50 Etc/GMT-8, j o a r wrote:

> You need to set the controller to be the data source and delegate of
> your outline view. You can do this in IB by dragging "reverse" springs
> from the controller to the outline view, or in code in "awakeFromNib".
>
> j o a r
>
> On Wednesday, Mar 5, 2003, at 10:40 Europe/Stockholm, Anthony Cheung
> wrote:
>
>> I am trying implement a OutlineView to my application. I have added
>> that through IB, created an outlet for it and the link between my
>> controller class. I have implemented the following
>>
>> - (id)outlineView:(NSOutlineView *)olv child:(int)index
>> ofItem:(id)item;
>> - (BOOL)outlineView:(NSOutlineView *)olv isItemExpandable:(id)item;
>> - (int)outlineView:(NSOutlineView *)olv
>> numberOfChildrenOfItem:(id)item;
>> - (id)outlineView:(NSOutlineView *)olv
>> objectValueForTableColumn:(NSTableColumn *)tableColumn
>> byItem:(id)item;
>>
>> in my source. I have set breakpoints. When I debug my program, I found
>> out that those four procedures were never be visited. I think this may
>> be the reason why I can't loaded data to the table.
_______________________________________________
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.

  • Follow-Ups:
    • Re: OutlineView
      • From: j o a r <email@hidden>
References: 
 >Re: OutlineView (From: j o a r <email@hidden>)

  • Prev by Date: Functions in Cocoa
  • Next by Date: Re: Functions in Cocoa
  • Previous by thread: Re: OutlineView
  • Next by thread: Re: OutlineView
  • Index(es):
    • Date
    • Thread