Results 1 to 3 of 3

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Boolean Problems

  1. #1
    Default Boolean Problems
    Hi i need help to read and edit a boolean value in object c. how can i do that? can you take me an example ?

  2. #2
    Green Apple truehybridx's Avatar
    Join Date
    Dec 2007
    Location
    Mustang Ridge, Texas, United States
    Posts
    91
    Thanks
    1
    Thanked 10 Times in 10 Posts

    Where are you trying to read it from? a PLIST?? UserDefaults?? Blankspace??


    Code:
        // From user defaults
        BOOL someBool = [[NSUserDefaults standardUserDefaults] objectForKey:<someKey>];
        
        // From plist
        NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:<filePath>];
        BOOL someBool = [plist objectForKey:<someKey>];
    Last edited by truehybridx; 12-30-2011 at 09:29 AM.
    Get the latest info for NoAccSplash Here
    Currently it should work on iOS 4.x - 6.x
    If you'd like to help extend its functionality, the source is also available.

  3. #3
    Quote Originally Posted by truehybridx View Post
    Where are you trying to read it from? a PLIST?? UserDefaults?? Blankspace??


    Code:
        // From user defaults
        BOOL someBool = [[NSUserDefaults standardUserDefaults] objectForKey:<someKey>];
        
        // From plist
        NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:<filePath>];
        BOOL someBool = [plist objectForKey:<someKey>];
    oh sorry :P i want to read from a plist

    i have try it

    Code:
    check = [filePath objectForKey:@"Test"];
    check is a string, and then i send it to a label

    Code:
    Test.text = check;
    but my app in iOS Crash at launch with this code(only if i take a bool value from plist)

    how can i fix that?

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