iOS Settings settings

Source: Internet
Author: User

Results show

1. Create Setttings.bundle

2, modify the Root.plist

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" ><plist Version= "1.0" ><dict><key>PreferenceSpecifiers</key><array><dict><key> Defaultvalue</key><string>1.0</string><key>key</key><string>app_version </string><key>Title</key><string> version </string><key>Type</key>< String>pstitlevaluespecifier</string></dict><dict><key>title</key><string ></string><key>Type</key><string>PSGroupSpecifier</string></dict>< dict><key>file</key><string>userprotocol</string><key>key</key>< String></string><key>title</key><string> User Agreement </string><key>type</key ><string>pschildpanespecifier</string></dict><dict><key&Gt file</key><string>pravacyprotocol</string><key>key</key><string></ String><key>title</key><string> Privacy Agreement </string><key>type</key><string >PSChildPaneSpecifier</string></dict></array><key>StringsTable</key>< String>root</string></dict></plist>

  

3. Create a plist file corresponding to the two sub-panels in the root.plist:

Userprotocol.plist

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" ><plist Version= "1.0" ><dict><key>new item</key><string></string><key> Stringstable</key><string>root</string><key>preferencespecifiers</key><array >        <dict>            <key>Type</key>            <string>PSGroupSpecifier</string>            <key>Title</key>            <string> User user </string>        </dict></array></dict ></plist>

  

Pravacyprotocol.plist

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" ><plist Version= "1.0" ><dict>    <key>StringsTable</key>    <string>Root</string>    <key>PreferenceSpecifiers</key>    <array>        <dict>            <key>type</ key>            <string>PSGroupSpecifier</string>            <key>Title</key>            <string> Privacy, privacy </string>        </dict>    </array></dict></plist>

  

4, ensure that root.plist userprotocol.plist pravacyprotocol.plist are in the Settings.bundle package

5. Script Read version number

Build Phase, "+" icon

6. Add Scripts

Version= '/usr/libexec/plistbuddy-c "Print cfbundleshortversionstring" $SRCROOT/sllivechild/info.plist '/usr/ Libexec/plistbuddy "$SRCROOT/sllivechild/settings.bundle/root.plist"-C "set Preferencespecifiers:0:defaultvalue $ Version

Comments:

Preferencespecifiers:0:defaultvalue means the No. 0 item under the preferencespecifiers of this array defaultvalue


At last
Reference:

Http://blog.rocketmade.com/post/60213039759/how-to-automatically-add-version-and-build-number

Http://stackoverflow.com/questions/6851660/version-vs-build-in-xcode

iOS Settings settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.