File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,14 @@ + (BFTask *)_pinEventually:(PFObject *)object
158
158
pin[PFEventuallyPinKeyCommand] = commandDictionary;
159
159
}
160
160
161
- return [[pin pinInBackgroundWithName: PFEventuallyPinPinName] continueWithBlock: ^id (BFTask *task) {
161
+ // NOTE: This is needed otherwise ARC releases the pins before we have a chance to persist the new ones to disk,
162
+ // Which means we'd lose any columns on objects in eventually pins not currently in memory.
163
+ __block NSArray *existingPins = nil ;
164
+ return [[[self findAllEventuallyPin ] continueWithSuccessBlock: ^id (BFTask *task) {
165
+ existingPins = task.result ;
166
+ return [pin pinInBackgroundWithName: PFEventuallyPinPinName];
167
+ }] continueWithSuccessBlock: ^id (BFTask *task) {
168
+ existingPins = nil ;
162
169
return pin;
163
170
}];
164
171
}
You can’t perform that action at this time.
0 commit comments