• 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
How to store main window frame to user defaults?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to store main window frame to user defaults?


  • Subject: How to store main window frame to user defaults?
  • From: Vyacheslav Karamov <email@hidden>
  • Date: Thu, 28 Apr 2011 11:50:20 +0300

Hi All!

I need to save main window size and position to user defaults:

NSValue * rect = [NSValue valueWithRect: [[NSApp mainWindow] frame]];
[[NSUserDefaults standardUserDefaults] setObject:rect forKey:@"MainWndFrame"];


but console output is:

2011-04-28 11:45:00.139 UserDefaults[32801:a0f] *** -[NSUserDefaults setObject:forKey:]: Attempt to insert non-property value 'NSRect: {{525, 701}, {303, 99}}' of class 'NSConcreteValue'.
_______________________________________________


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


  • Follow-Ups:
    • Re: How to store main window frame to user defaults?
      • From: Aaron Burghardt <email@hidden>
  • Prev by Date: Re: BSD TCP Programming on iPad
  • Next by Date: Re: How to store main window frame to user defaults?
  • Previous by thread: OpenGL paint program
  • Next by thread: Re: How to store main window frame to user defaults?
  • Index(es):
    • Date
    • Thread