• 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
Another setFrameAutosaveName problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another setFrameAutosaveName problem


  • Subject: Another setFrameAutosaveName problem
  • From: Dragan MiliÄ <email@hidden>
  • Date: Thu, 11 Mar 2004 20:02:58 +0100

Hello everyone.

I'm not experienced Cocoa programmer, so perhaps I don't understand how things work exactly. I consulted documentation too, but was unable to find anything to resolve my problem. So, here it is:

Suppose I have an instance of NSSplitView class as window's contentView. The upper half o split view is occupied by an instance of NSTableView class, showing records in its rows, which are, let's say, messages with attributes such are sender, subject, date etc. The bottom half of the split view is occupied by an instance of NSTextView, which shows the text of the message selected in the upper table view. When selection is changed, the appropriate message text is shown as a result of NSTableViewSelectionDidChangeNotification being posted. When the app launches, I want to select the message (that's row) which was selected right upon termination. For that purpose I use user defaults database. So, when the app starts, I fetch last selected row index from the database and in windowDidLoad: method of window controller programatically select that row of table view, which results in appropriate message text appearing inside text view. That worked fine. Then, I wanted window position and size on the screen to be remembered as well. I put window's setFrameAutosaveName: method call into same windowDidLoad: and programatic selecting of table view's row at startup works as long as I don't change window's position or size. Once it's done, table view's row selecting won't work on subsequent relaunches, until I remove setFrameAutosaveName call. By tracing execution in GDB I actually realised that code which should select table view's row executes, but no row is selected, and no notification is posted.

Maybe this isn't the right way to implement that feature, but before suggesting any other, I would like to know why the method described above won't work.

Best regards,

Milke.
_______________________________________________
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.


  • Prev by Date: finding all (OS X) Macs on a local network ?
  • Next by Date: Re: I want the NSProgressIndicator to stand still!!!
  • Previous by thread: Re: finding all (OS X) Macs on a local network ?
  • Next by thread: TableView crash when scrolling to out of view rows
  • Index(es):
    • Date
    • Thread