• 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: Question about Outline View code in Documentation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about Outline View code in Documentation


  • Subject: Re: Question about Outline View code in Documentation
  • From: James McConnell <email@hidden>
  • Date: Fri, 06 Feb 2004 22:15:03 -0600

On 2/6/04 9:49 PM, "mmalcolm crawford" <email@hidden> wrote:

> On Feb 6, 2004, at 7:15 PM, James McConnell wrote:
>
>> Greetings, all. In /Developer/Examples/AppKit/Outline View, the
>> project has
>> a file for FileSystemItem, representing a file system item.
>> [...]
>> By default, it is set at "/". I would like this set to
>> "/Users/myuseraccount/Documents/folder", where "myuseraccount" is the
>> account this app will be running under
>
> One way (though you're left with the full path displayed at the root --
> you could do this more elegantly):
>
> To FileSystemItem.h add:
>
> - (void)setRelativePath:(NSString *)newRelativePath;
>
>
> To FileSystemItem.m add:
>
> - (void)setRelativePath:(NSString *)newRelativePath {
> [relativePath autorelease];
> relativePath = [newRelativePath copy];
> }
>
> Then replace:
>
> - (id)initWithPath:(NSString *)path parent:(FileSystemItem *)obj {
> if (self = [super init]) {
> [self setRelativePath:[path lastPathComponent]];
> parent = obj;
> }
> return self;
> }
>
> + (FileSystemItem *)rootItem {
> if (rootItem == nil)
> {
> NSString *rootPath = NSHomeDirectory();
> rootItem = [[FileSystemItem alloc] initWithPath:rootPath
> parent:nil];
> [rootItem setRelativePath:rootPath];
> }
> return rootItem;
> }
>
>
> mmalc
> _______________________________________________
> 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.


I think I can work with that, thanks! I can get the home directory, then
append "/Documents/Folder". Any clue as to how I can get it not to show
hidden, "." files? Or is that in the documentation on Outline View I'm not
seeing? Thanks a lot!
_______________________________________________
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: Question about Outline View code in Documentation
      • From: mmalcolm crawford <email@hidden>
References: 
 >Re: Question about Outline View code in Documentation (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Question about Outline View code in Documentation
  • Next by Date: Re: Question about Outline View code in Documentation
  • Previous by thread: Re: Question about Outline View code in Documentation
  • Next by thread: Re: Question about Outline View code in Documentation
  • Index(es):
    • Date
    • Thread