Ios,plist file, PCH file

Source: Internet
Author: User

1. Using PCH Files

2. Configure the URL in Info.plist schemes

3.plist configuration Camera interface, copy, paste and other menu display language display in Chinese

PCH files can be used to store shared information

* Store some global macros (macros used throughout the project)

* Used to include all header files (header files used throughout the project) * can automatically turn on or off the log output function
Xcode6 previously created the PCH file automatically, the new version to be created manually, is Xcode7

Then in the project targets inside the building setting will precompile Prefix header to the right of the No to Yes and then Precompile Prefix header below the Prefix header right double-click, Add the project path of the PCH file that you just created, add the format: "$ (srcroot)/pch file under project path/pch filename", $ (srcroot) means the project root directory. If you're not sure, you can right-click the PCH file and show in Finder. (I used: $ (srcroot)/myim/customshared.pch) then you can import the header file that you want to use, or the macro definitionConfigure the URL in Info.plist schemesAdd the following attribute to the Info.plist file in Project A to add the following method to the project's APPDELGATE.M file

-(BOOL) Application: (UIApplication *) app OpenURL: (nsurl *) URL options: (nsdictionary<nsstring *,id> *) options{

Pass over the request string

NSString *text=[[url Host] stringbyaddingpercentencodingwithallowedcharacters:[ Nscharacterseturlqueryallowedcharacterset]];

Uialertcontroller *alert=[uialertcontroller alertcontrollerwithtitle:@ "Punch" Message:text PreferredStyle: Uialertcontrollerstylealert];

Uialertaction *cancel=[uialertaction actionwithtitle:@ "Cancel" Style:uialertactionstylecancel Handler:nil];

[Alert Addaction:cancel];

[Self.window.rootViewController Presentviewcontroller:alert Animated:YEScompletion:nil];

return YES;

}

Enter a test in Safari

vieim://user=123,pwd=456

4. Test in app, need to add trusted app

Info.plist Join

<key>LSApplicationQueriesSchemes</key>

<array>

<string>urlscheme</string>

<string>urlscheme2</string>

<string>urlscheme3</string>

<string>urlscheme4</string>

</array>

Call

[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "URL scheme://url identifier"];

The result shows that the app's address composition is: URL scheme://url identifier

The word behind the myapp://can be a point "." And the equals sign "=" cannot be a space and a question mark

plist Configuration Camera interface, copy, paste and other menu display language display in Chinese

In plist localization native development region chooses China,

Then localized resources can be mixed select YES, if there is no localized resources can be mixed, you need to manually add

Ios,plist file, PCH file

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.