I have a number of methods in blocks, firing one inside the next, in order to sync some data with a web service. Most of these behave completely fine, but one method won't let me mention self
after it's been called, giving me a capturing self strongly in this block is likely to lead to a retain cycle
warning.
Here's what I mean:
[self deleteEntriesCorrespondingToDeletedNotesInNotebook:notebook success:^{
[self deleteNotesToMatchDeletedEntriesWithCompletion:^{
[self deleteResourcesToMatchDeletedMediaItemsWithCompletion:^{
[self addOrUpdateEntriesCorrespondingToUpdatedNotesInNotebook:notebook success:^{
//Anything calling a property or self after this point is a problem and gives the warning
[self addOrUpdateNotesCorrespondingToUpdatedEntriesWithCompletion:^{
}];
}failure:^{
}];
}];
}];
}failure:^{
}];
Any ideas why only items passed this point have a problem with this? If I replace the method before it with another similar method, there isn't a problem. The problem is only existent after addOrUpdateEntriesCorrespondingToUpdatedNotesInNotebook:
is used.