• 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
SOLVED (workaround): Removing *other* app default?!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED (workaround): Removing *other* app default?!?


  • Subject: SOLVED (workaround): Removing *other* app default?!?
  • From: Ondra Cada <email@hidden>
  • Date: Sat, 17 Apr 2004 13:56:00 +0200

Thanks all,

On 17.4.2004, at 2:37, Charles Srstka wrote:

> Am I misunderstanding what you need to do, or are -[NSUserDefaults
> persistentDomainForName:]

That is exactly is what I use for reading the others' defaults. To
write them though I can't (or perhaps rather should not), since the
setPersistentDomain:forName: documentation explicitly says "domainName
should be your applications bundle identifier" -- which it is not, in
this case.

> and -[NSUserDefaults removePersistentDomainForName:] all you need?

I don't want to remove whole domain, just to change some default. Not
speaking of the fact that "domainName should be your applications
bundle identifier" is there, too.

On 17.4.2004, at 5:08, Louis C. Sacha wrote:

> This may sound kind of odd, but I think the functionality you're
> looking for is available in the ScreenSaver API (which uses obj-C),
> specifically ScreenSaverDefaults.

Wow!

Well I think I shall stick with pretty ugly, but simple and functional
workaround of

static void setDefaultInDomainToInt(NSString *domain,NSString
*key,NSString *value) {
NSString *cmd=[NSString stringWithFormat:value?@"defaults write %@ %@
%@":@"defaults delete %@ %@",domain,key,value];
system([cmd UTF8String]);
[[NSUserDefaults standardUserDefaults] synchronize];
}

Thanks anyway!
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.


References: 
 >Removing *other* app default?!? (From: Ondra Cada <email@hidden>)
 >Re: Removing *other* app default?!? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: The bitmap image type from an NSBitmapImageRep?
  • Next by Date: Cocoa vs User: 0 - 1
  • Previous by thread: Re: Removing *other* app default?!?
  • Next by thread: Re: Removing *other* app default?!?
  • Index(es):
    • Date
    • Thread