Value not being written to plist!!

Discussion in 'iOS Development' started by ipodtouchmaster05, Jul 2, 2008.

  1. ipodtouchmaster05

    ipodtouchmaster05 Well-Known Member

    Joined:
    Sep 30, 2007
    Messages:
    1,787
    Likes Received:
    41
    Device:
    iPhone 5 (Black)
    Ok heres part of my code im trying to write whatever the application folder name is, remove the .app, and put that in the Info.plist. Now I have correct permissions and everything its 755 +s and it still wont write to the plist, it compiles fine and everything. so what did I do wront? thanks
    Code:
    if([ [ [ sheet textField ] text ] isEqualToString: [ j stringForKey:@"Password" inFile: [ NSString stringWithFormat:@"/Applications/Lockdown.app/Info.plist"] ] ])
                                    {
            NSMutableDictionary* infoPlist = [[NSMutableDictionary alloc] initWithDictionary:[[NSBundle mainBundle] infoDictionary]];  
            NSString *version = [infoPlist objectForKey:@"CFBundleExecutable"];  
            NSBundle *bundle = [NSBundle mainBundle]; 
            [infoPlist setObject: [ NSString stringWithFormat:@"%@", [[bundle.bundlePath lastPathComponent] stringByDeletingPathExtension]] forKey: @"CFBundleExecutable"]; 
            NSLog (@"file %@", [[bundle.bundlePath lastPathComponent] stringByDeletingPathExtension]); 
            [infoPlist writeToFile: [ NSString stringWithFormat:@"/Applications/%@/Info.plist", bundle.bundlePath ] atomically: YES]; 
    [sheet dismiss];
    [aboutsheet popupAlertAnimated: YES];
  2. crizh4x

    crizh4x Active Member

    Joined:
    Sep 19, 2007
    Messages:
    4,474
    Likes Received:
    17
    Device:
    2G iPod touch
    I am about to finish setting up the toolchain etc. so that I can get into this Objective C stuff once and for all. But please for all that is sacred, let me design you a new icon. That thing is soooo..... 80's esque that is scares me. I will give you a big version of my idea soon.

    HERE take it plz! lol

    Please Register or Log in to view images

  3. ipodtouchmaster05

    ipodtouchmaster05 Well-Known Member

    Joined:
    Sep 30, 2007
    Messages:
    1,787
    Likes Received:
    41
    Device:
    iPhone 5 (Black)
    ha chris nice icon, pm me please. Anyway can anyone help with my question?
  4. Faktor4

    Faktor4 Active Member

    Joined:
    Dec 26, 2007
    Messages:
    597
    Likes Received:
    34
    there... i sent you the fix on AIM.
  5. ipodtouchmaster05

    ipodtouchmaster05 Well-Known Member

    Joined:
    Sep 30, 2007
    Messages:
    1,787
    Likes Received:
    41
    Device:
    iPhone 5 (Black)
    tried tht it didnt work
  6. Faktor4

    Faktor4 Active Member

    Joined:
    Dec 26, 2007
    Messages:
    597
    Likes Received:
    34
    cuz you forgot to douche your throat. lol jk sweetie.

    did you change it to NSLog? or whatever it said.
  7. Totally 1337

    Totally 1337 Active Member

    Joined:
    Mar 27, 2008
    Messages:
    3,966
    Likes Received:
    17
    Device:
    iPhone 4S (Black)
    ummmm......ook....
  8. ipodtouchmaster05

    ipodtouchmaster05 Well-Known Member

    Joined:
    Sep 30, 2007
    Messages:
    1,787
    Likes Received:
    41
    Device:
    iPhone 5 (Black)
  9. vieestchien

    vieestchien New Member

    Joined:
    May 7, 2008
    Messages:
    43
    Likes Received:
    1
    Try to change the write command to atomically: NO.
  10. ipodtouchmaster05

    ipodtouchmaster05 Well-Known Member

    Joined:
    Sep 30, 2007
    Messages:
    1,787
    Likes Received:
    41
    Device:
    iPhone 5 (Black)
    LOL no that wouldnt work, and I fixed it already.

Share This Page