Retired Document
Important:
The information in this document is deprecated in Mac OS X v10.7; don't use it for new development. Instead use the iCloud extensions to the NSFileManager
class to share file-based data and use the NSUbiquitousKeyValueStore
class to share preferences. Use the Address Book framework to access shared contact data and use the Calendar Store framework to access shared calendar data.
Registering and Viewing Schemas
If your client uses a custom schema or a schema extension, the first step is to register it with the sync engine. You can then view it using Syncrospector. You can also view existing schemas—for example, those used by Address Book, iCal, Mail, and other Apple applications. Using Syncrospector to view schemas is an easy way to verify that the sync engine is using the same entities and properties as your client.
Schemas used by Apple applications are also described in Apple Applications Schema Reference. Read Registering Schemas to programmatically register schemas.
Download the SimpleStickies sample code project to follow along in this chapter.
Registering Schemas
Occasionally during development you might need to register a schema manually. For example, you might do this if your client relies on another client to register the schema and it has not done so. You can also unregister a schema if you change it during development. You can also unregister the clients that use that schema.
Follow these steps to register a schema:
Launch your client which registers your schema.
Open
SimpleStickies.xcode
, located in theSyncServices_SimpleStickies
folder and click Build and Go in Xcode to launch the application or follow launch your own client.Launch Syncrospector, located in the
/Developer/Applications/Utilities
folder.Choose Schema from the left-side pop-up menu.
Click Register in the toolbar.
Select the schema file in the dialog that appears and click Register.
If successful, the schema appears in the table below the toolbar.
Follow these steps to unregister a schema (this unregisters all the clients that use the schema too):
Launch Syncrospector.
Choose Schema from the left-side pop-up menu.
Select the schema you want to unregister from the table below the toolbar.
Click Unregister in the toolbar.
Follow these steps if you want to just unregister clients that use a schema:
Launch Syncrospector.
Choose Clients from the left-side pop-up menu.
Select the client from the table below the toolbar.
Click Unregister in the toolbar.
Viewing Schemas
If you use a custom schema or a schema extension, follow these steps to view the schema using Syncrospector:
If necessary, launch your client to register the new schema or schema extension.
Launch Syncrospector.
Choose Schema from the left-side pop-up menu.
Select the schema from the table below, as shown in Figure 2-1.
View the entities in the schema in the detail pane below the table.
Double-click an entity or click Show Details to view the properties in a separate window, as shown in Figure 2-2.
A key appears in the first column if the property is an identity key. A checkmark appears in the R column if the property is required. If a “>” character appears in the O column, then the property is a relationship; otherwise, it’s an attribute. A checkmark appears in the X column if the property is excluded from data change alerts (see Displaying Data Change Alerts for how to turn on data change alerts for all clients). If the property is an attribute, the type is displayed in the Type/Destination column; otherwise, the destination entity name is displayed for a relationship.
Click General to view other details such as property dependencies. Read Property Dependencies for how to specify property dependencies in a schema.
Copyright © 2011 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2011-07-06