RestKit NSFetchRequest Block for deletion of orphaned objects

前端 未结 1 1102
温柔的废话
温柔的废话 2021-01-22 16:26

I have a Rest api hosted over my .com domain which on receiving request like this www.mydomain.com/api/lists will return the json formatted data as shown below

[         


        
1条回答
  •  鱼传尺愫
    2021-01-22 17:09

    You can't do this:

    listID = [argsDict objectForKey:@"list_id"];
    NSLog(@"The listID is %@",listID);
    

    because there is no list_id parameter in the path pattern /api/lists. So, if this data is missing, your predicate will always be checking for the wrong listID.

    But, you don't need any of that. Assuming that the request returns all of the objects from the server - the only time you should be using fetch blocks - then you don't need a predicate. Just create a fetch request for the entity and return it without any predicate.

    0 讨论(0)
提交回复
热议问题