• 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: Preferences binding update NSTextField and user defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferences binding update NSTextField and user defaults


  • Subject: Re: Preferences binding update NSTextField and user defaults
  • From: Ferhat Ayaz <email@hidden>
  • Date: Wed, 27 Dec 2006 23:52:15 +0100


aja, thanks. This is a work around due to leak of auto increment in CoraData.



- (void)awakeFromInsert
{
[super awakeFromInsert];
NSUserDefaultsController *defaults = [NSUserDefaultsController sharedUserDefaultsController];
NSString *num = [[defaults values] valueForKey:@"Counter"];
int counter = [num intValue];
[[defaults values] setValue:[NSString stringWithFormat:@"%d",counter +1] forKey:@"Counter"];
NSString *format = [[defaults values] valueForKey:@"Format"];
[self setValue:[NSString stringWithFormat:format,counter] forKey:@"nr"];
[self setValue:[NSDate date] forKey:@"creationDate"];
}



On Dec 27, 2006, at 10:46 PM, mmalc crawford wrote:


On Dec 27, 2006, at 1:43 PM, Ferhat Ayaz wrote:

I'm using a preferences panel in my application and have bind TextFields to user defaults.
I don't know how to get and set user defaults.


<http://www.google.com/search?rls=en-us&q=user+defaults+cocoa +bindings&ie=UTF-8&oe=UTF-8>

mmalc


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Preferences binding update NSTextField and user defaults
      • From: Scott Stevenson <email@hidden>
References: 
 >Preferences binding update NSTextField and user defaults (From: Ferhat Ayaz <email@hidden>)
 >Re: Preferences binding update NSTextField and user defaults (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Completely remove a window (from NSApp)?
  • Next by Date: Re: Completely remove a window (from NSApp)?
  • Previous by thread: Re: Preferences binding update NSTextField and user defaults
  • Next by thread: Re: Preferences binding update NSTextField and user defaults
  • Index(es):
    • Date
    • Thread