Delete Operation

The delete operation allows the client to delete a new record in the local database. To propagate the changes to the server, call submitPending.

(void)delete

The following examples show how to perform deletes to parent entities and child entities.

Example 1: Supports delete operations to parent entities. The sequence of calls is:

SampleApp_Customer *customer = [ SampleApp_Customer find: 32]
[customer delete];
[customer submitPending];
while ([SampleApp_SampleAppDB hasPendingOperations])
		[NSThread sleepForTimeInterval:0.2];

Example 2: Supports delete operations child entities. The sequence of calls is:

SampleApp_Sales_order  *order = [SampleApp_Sales_order find: 32]
[order delete];
[order.customer submitPending]; //Call submitPending on the parent.
while ([SampleApp_SampleAppDB hasPendingOperations])
		[NSThread sleepForTimeInterval:0.2];