• 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: Pointing OutlineView to a folder on the Desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pointing OutlineView to a folder on the Desktop


  • Subject: Re: Pointing OutlineView to a folder on the Desktop
  • From: David Yamartino <email@hidden>
  • Date: Fri, 20 Mar 2009 10:53:21 +1000

Thanks, Corbin.
Yes, I had misunderstood "rootItem" and that was the problem.

David

On Fri, Mar 20, 2009 at 1:29 AM, Corbin Dunn <email@hidden> wrote:

> Modify the rootItem method in FileSystemItem to be the root path that you
> are interested in. That's the model object, which you need to change. The
> code below is the controller object, and is simply controlling the view.
>
> .corbin
>
>
> On Mar 18, 2009, at 4:19 AM, David Yamartino wrote:
>
>  Below is the code  for "OutlineView" (on your machine in
>> Developer/Examples/AppKit/OutlineView). It presents an expandable view of
>> everything on your machine from  /  (root).
>> How would I point  this app to look at a specific folder (say "Library")
>> located on the desktop?
>>
>> I've experimented,  but can't figure out how to identify the path as this:
>>
>> * /Users/k2/Desktop/Library*
>>
>> as  opposed to
>>
>> *  / (root).*
>>
>> I don't want to see everything on my machine, just what's in the folder.
>>
>> I appreciate your your help.
>>
>>
>> =-=-==-=-=-==- ======================
>>
>>
>> #import "DataSource.h"
>>
>> #import "FileSystemItem.h"
>>
>>
>> @implementation DataSource
>>
>>
>> // Data Source methods
>>
>>
>> - (NSInteger)outlineView:(NSOutlineView *)outlineView
>> numberOfChildrenOfItem:(id)item {
>>
>>   return (item == nil) ? 1 : [item numberOfChildren];
>>
>> }
>>
>>
>> - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item
>> {
>>
>>   return (item == nil) ? YES : ([item numberOfChildren] != -1);
>>
>> }
>>
>>
>> - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index
>> ofItem:(id)item {
>>
>>   return (item == nil) ? [FileSystemItem rootItem] :
>> [(FileSystemItem*)item
>> childAtIndex:index];
>>
>> }
>>
>>
>> - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(
>> NSTableColumn *)tableColumn byItem:(id)item {
>>
>>   return (item == nil) ? @"/" : (id)[item relativePath];
>>
>> }
>>
>>
>> // Delegate methods
>>
>>
>> - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(
>> NSTableColumn *)tableColumn item:(id)item {
>>
>>   return NO;
>>
>> }
>>
>>
>> @end
>> _______________________________________________
>>
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Pointing OutlineView to a folder on the Desktop (From: David Yamartino <email@hidden>)
 >Pointing OutlineView to a folder on the Desktop (From: David Yamartino <email@hidden>)
 >Re: Pointing OutlineView to a folder on the Desktop (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: Easy question about bindings for a custom view
  • Next by Date: Re: ERROR:Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments
  • Previous by thread: Re: Pointing OutlineView to a folder on the Desktop
  • Next by thread: ABPeoplePickerView - remove search field
  • Index(es):
    • Date
    • Thread