Professional Web Applications Themes

Force update of .plist file for running app? - Mac Programming

I am working on an application that makes heavy use of the preferences ..plist file for storing information. It's easy enough to gain read access to this info during application start-up and to update the info when the application quits using the [NSUserDefaults standardUserDefaults] routines. However, I would like to be able to force the plist file to be updated WHILE the program is running, and even better would be to update the defaults structure if the plist is changed from outside the application. From reading about NSUserDefaults, it appears that: [[NSUserDefaults standardUserDefaults] synchronize]; should do what I want, but ...

  1. #1

    Default Force update of .plist file for running app?

    I am working on an application that makes heavy use of the preferences
    ..plist file for storing information. It's easy enough to gain read
    access to this info during application start-up and to update the info
    when the application quits using the [NSUserDefaults
    standardUserDefaults] routines.

    However, I would like to be able to force the plist file to be updated
    WHILE the program is running, and even better would be to update the
    defaults structure if the plist is changed from outside the application.

    From reading about NSUserDefaults, it appears that:

    [[NSUserDefaults standardUserDefaults] synchronize];

    should do what I want, but this doesn't seem to have any effect on the
    ..plist file until AFTER I quit the application.

    Any ideas on how I can accomplish this? Basically, I want other
    applications to be able to update the UserDefaults information for my
    application....


    TIA,

    Fletcher

    --
    Fletcher T. Penney
    http://fletcher.freeshell.org/

    Do not reply by email - the address doesn't work...
    Fletcher Guest

  2. #2

    Default Re: Force update of .plist file for running app?

    In article <net>,
    "Fletcher T. Penney" <net> wrote:
     

    Then something is wrong either in your environment or in your
    interpretation of the result. I use that method quite a bit.

    Is it possible, perhaps, that the app interested in changes is
    synchronizing its notion of the defaults before the app making the
    changes has synchronized?

    G

    --
    Standard output is like your butt. Everyone has one. When using a bathroom,
    they all default to going into a toilet. However, a person can redirect his
    "standard output" to somewhere else, if he so chooses. - Jeremy Nixon
    Gregory Guest

  3. #3

    Default Re: Force update of .plist file for running app?

    In article <comcast.net>,
    Gregory Weston <com> wrote:
     
    >
    > Then something is wrong either in your environment or in your
    > interpretation of the result. I use that method quite a bit.
    >
    > Is it possible, perhaps, that the app interested in changes is
    > synchronizing its notion of the defaults before the app making the
    > changes has synchronized?
    >
    > G[/ref]


    :)

    I rechecked - the data I was testing was actually kept in a separate
    variable, and then re-applied to the defaults before quitting. When I
    checked with some preferences that are linked directly to the defaults,
    it worked as I had hoped.

    Thanks for verifying that this should work - I just need to add a few
    commands to the synchronization.


    F-


    --
    Fletcher T. Penney
    http://fletcher.freeshell.org/

    Do not reply by email - the address doesn't work...
    Fletcher Guest

Similar Threads

  1. Query caching how to I force update
    By SilentBob'secretfusion in forum Coldfusion Database Access
    Replies: 7
    Last Post: September 14th, 03:04 PM
  2. Force update datagrid
    By PaulNaude in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: October 12th, 01:41 PM
  3. Manually force re-running of application.cfc
    By chris.mellon in forum Macromedia ColdFusion
    Replies: 2
    Last Post: August 26th, 07:08 AM
  4. force a browser to update
    By gerb in forum PHP Development
    Replies: 0
    Last Post: April 2nd, 10:41 PM
  5. How to force progress bar update without a runloop
    By matt neuburg in forum Mac Programming
    Replies: 0
    Last Post: August 12th, 06:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139