• 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: Saving State of NSOutlineView in Document-based App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving State of NSOutlineView in Document-based App


  • Subject: Re: Saving State of NSOutlineView in Document-based App
  • From: "Kirt Cathey" <email@hidden>
  • Date: Tue, 29 Mar 2005 03:15:24 +0000

Shawn,

Thanks alot! I eventually figured all this out at the following web site:
http://www.macocoa.omitech.it/capitoli/mc017.htm

It's in Italian (I have no idea what they are saying), but the source code attached speaks for itself.

Regards,
From the desk of ..........
                   Barking Frog
email: email@hidden



From: Shawn Erickson <email@hidden>
To: "Kirt Cathey" <email@hidden>
CC: email@hidden
Subject: Re: Saving State of NSOutlineView in Document-based App
Date: Mon, 28 Mar 2005 09:25:58 -0800


On Mar 26, 2005, at 5:11 PM, Kirt Cathey wrote:

After reviewing another posting in this archive, I added the following in the init portion of the data source.
[outline setAutosaveName:@"Subscriptions Outline"];
[outline setDataSource:dataSource];
[outline setDelegate:dataSource];
[outline setAutosaveExpandedItems:YES];


Then in the data source also added the following methods:

- (id)outlineView:(NSOutlineView *)outlineView persistentObjectForItem:(id)item
{
return [NSKeyedArchiver archivedDataWithRootObject:item];
}


- (id)outlineView:(NSOutlineView *)outlineView itemForPersistentObject:(id)object
{
return [NSKeyedUnarchiver unarchiveObjectWithData:object];
}


All of which is verbatim off of the existing archives. Upon debugging, the first set of statements included in the data source init section are called, but the associated methods are not called at all.

When you see these called is the "outline" outlet actually valid (not nil)?


If your data source is an object instantiated in your nib then you cannot do the calls against the outlet at init time but have to do it at awakeFromNib time.

-Shawn


_________________________________________________________________
楽しい絵文字でココロ伝わるメッセンジャー http://messenger.msn.co.jp/


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Saving State of NSOutlineView in Document-based App (From: Shawn Erickson <email@hidden>)

  • Prev by Date: NSComboBox and lack of notification...
  • Next by Date: Re: Saving State of NSOutlineView in Document-based App
  • Previous by thread: Re: Saving State of NSOutlineView in Document-based App
  • Next by thread: Re: Saving State of NSOutlineView in Document-based App
  • Index(es):
    • Date
    • Thread