• 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: modifying info dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: modifying info dictionary


  • Subject: Re: modifying info dictionary
  • From: "Oscar Bascara" <email@hidden>
  • Date: Fri, 17 Aug 2007 14:12:33 -0700

On 8/17/07, I. Savant <email@hidden> wrote:
> On 8/17/07, Douglas Davidson <email@hidden> wrote:
> > >       NSDictionary *dict = [[NSBundle mainBundle] infoDictionary];
> > >       NSString *hrc = [dict objectForKey:@"NSHumanReadableCopyright"];
> > >       hrc = [NSString stringWithFormat:@"%@ (extra information here)",
> > > hrc];
> > >       [dict setValue:hrc forKey:@"NSHumanReadableCopyright"];
> > >
> > > Is this an acceptable modification?  Are there any side effects that I
> > > should know about?
> >
> > No, this is not acceptable.  As you see, -infoDictionary returns an
> > NSDictionary, not an NSMutableDictionary.  You do not get to modify it.
>
>   Moreover, even if you were to obtain a mutable copy of that
> dictionary and mangle it to your heart's content, there is still no
> setter mechanism that allows you to set a bundle's info dictionary
> (which would necessitate changes written to the bundle on disk). Any
> kind of bundle (application or otherwise) that operates on itself is
> usually a disaster waiting to happen, which is probably why there are
> no "convenient" ways to do so.
>

Okay, thanks for the good advice, I won't modify the About dialog this
way.  (A weird thing is that I can modify the info dictionary,
possibly because I have the correct user privileges as another poster
noted, and the About dialog does get modified.  Also, I didn't notice
anything getting written to the bundle on the disk, but who knows what
could happen.)

Thanks,
Oscar

> --
> I.S.
>
_______________________________________________

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: modifying info dictionary
      • From: Douglas Davidson <email@hidden>
References: 
 >modifying info dictionary (From: "Oscar Bascara" <email@hidden>)
 >Re: modifying info dictionary (From: Douglas Davidson <email@hidden>)
 >Re: modifying info dictionary (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Proper way to use NSUserDefaults + Bindings + Keychain
  • Next by Date: Re: Inheritance question
  • Previous by thread: Re: modifying info dictionary
  • Next by thread: Re: modifying info dictionary
  • Index(es):
    • Date
    • Thread