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.