XCode Kommentare

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Hallo,

    das pbxproj file ist einfach eine PList: Dieser Code sucht nach bestimmten (auch einem selbstdefinierten) Property, aber damit kannst Du praktisch nach allem suchen.

    Quellcode

    1. InfoPlist = [NSPropertyListSerialization propertyListFromData:[NSData dataWithContentsOfFile:pbxpath]
    2. mutabilityOption:NSPropertyListMutableContainersAndLeaves
    3. format:&plistFormat
    4. errorDescription:&error];
    5. myEnum = [[InfoPlist allKeys] objectEnumerator];
    6. while (theItem = [myEnum nextObject])
    7. {
    8. id subitem;
    9. subitem = [InfoPlist objectForKey:theItem];
    10. if ([theItem isEqualToString:@"objects"])
    11. pbxObjects = subitem;
    12. else if ([theItem isEqualToString:@"rootObject"])
    13. rootObject = subitem;
    14. }
    15. if (pbxObjects != nil && rootObject != nil)
    16. {
    17. NSDictionary * projectDesc = [pbxObjects objectForKey:rootObject];
    18. myEnum = [[projectDesc objectForKey:@"targets"] objectEnumerator];
    19. while (theItem = [myEnum nextObject])
    20. {
    21. id target = [pbxObjects objectForKey:theItem];
    22. id buildsettings;
    23. int result;
    24. buildsettings = [target objectForKey:@"buildSettings"];
    25. currentVersion = [buildsettings objectForKey:@"CURRENT_PROJECT_VERSION"];
    26. versionFile = [buildsettings objectForKey:@"VERSION_INFO_FILE"];
    27. productName = [buildsettings objectForKey:@"PRODUCT_NAME"];
    28. if (currentVersion != nil && versionFile == nil)
    29. {
    30. NSLog (@"No VERSION_INFO_FILE for target %@\n", productName);
    31. break;
    32. }
    33. else if (currentVersion != nil && versionFile != nil)
    34. {
    35. // Play that funky music, white boy
    36. }
    37. else
    38. result = 0;
    39. }
    40. }
    Alles anzeigen


    Hoffe es hilft,

    Alex
    The only thing that really worried me was the ether.