| Yes the target and selector can each be used. This is in fact the most straight forward to infer this information. Gordies' suggestion is superior to my second suggestion.
Bruce
On Nov 6, 2008, at 6:38 PM, Gordie Freedman wrote: Maybe I don't understand the question, but if you want to know what entities you are syncing in the callback from beginSessionInBackground, why not put that list in the target object that you pass in (which is the object the selector is called on)? Or use different selectors to represent the dataclasses (so beginSessionInBackground will callback to startSyncingCalendars, or startSyncingContacts depending on what you specified in the initial call to beginSessionInBackground which was based on the entities passed into the sync alert handler).
I prefer creating an object which has the entities in it, and making that object the target. On Nov 6, 2008, at 4:55 PM, Peter Walling wrote: Hi Bruce,
I didn't realize one app could register more than one sync client. I'll give that a try.
Thanks that's very helpful. Peter
On Thu, Nov 6, 2008 at 4:20 PM, Bruce D Nilo <email@hidden> wrote: There isn't any API to do this. This is arguably an oversight in the API. One way to solve this problem is to register 3 different sync clients that sync each data class. Each of these clients can be handled by the same code, but you would know which data class is being synced based on the client id of the client that your callback is invoked with. There are some performance arguments that could be made to go this route. Another less desirable solution is that you set the entities you are syncing with in the client info of the ISyncClient. For example before your call to beingSessionInBackgroundWithClient you could do something like: [client setObject: entityNames forKey:@"EntitiesBeingSynced"]. I am pretty sure your alert handler won't be called when there is an active sync plan. However, this kind of solution makes me a little nervous since there is the possibility that this could change. Hope that helps. Bruce On Nov 6, 2008, at 11:46 AM, Peter Walling wrote:
Hi, I have set up a sync alert handler where the handler supports 3 data classes, contacts, calendar and bookmarks. When something changes in one of these, say someone added a contact to the Address Book, my handler receives an array of contact entities to be synched. I then take the array of entities and pass it to beginSessionInBackgroundWithClient. Does anyone know a way of accessing this array in the selector method you provide to beginSessionBackgroundWithClient. It would really be helpful to know what entities in particular Mac Sync Services wants me to sync when my beginSession method is called. I thought about enabling and disabling the entities based on the request from Sync Services but reading the doc made this seem inappropriate. Any help would be greatly appreciated. Thanks, Peter
_______________________________________________ Do not post admin requests to the list. They will be ignored. Syncservices-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: %(user_optionsurl)s This email sent to %(user_address)s <ATT00001.txt> _______________________________________________ Do not post admin requests to the list. They will be ignored. Syncservices-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: %(user_optionsurl)s
This email sent to %(user_address)s
|