How to share keychain with multiple applications.

Source: Internet
Author: User

PreviousArticleI have reprinted a message about how to use keychain to store and read information.

Later, I saw multiple applications on the materials, and how to share a keychain, such as Baidu's multiple applications. Use the same account and password. It is not necessary for each application to have an independent password.

Therefore, multiple applications are used to share the same keychain.

1. In targets-> Summary of multiple applications, check entitlements to make it use entitlements file. This file name does not matter. After xcode4.5 is selected, A new file is automatically created.

2. Create a new one in the following keychain groups, twoProgramFor example, use Com. heqinstudio. mainchain. Note that this name has nothing to do with the program name or identifier.

3. Then start sharing. (Of course, they must read and store the key_in_keychain value and actually use the key value to access the same field in the keychain, the actual key value used by the key_in_keychain value is also irrelevant to the program name or identifier. We usually use the identitifier prefix with this program to better distinguish them .)

Program A can be stored.

[Wquserdatamanager
Savepassword:Self.Textfield.Text];

Program B reads data.

Self.Label.Text= [Wquserdatamanager
Readpassword];


Finally, we can see that the shared value in application A can be obtained by application B.

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.