Skip to content

Instantly share code, notes, and snippets.

function saveAllWithPromise(items) {
var saveAllPromise = new Parse.Promise();
Parse.Object.saveAll(items, {
success: function (items) {
saveAllPromise.resolve(items);
}, error: function (error) {
saveAllPromise.reject(error);
}
});
* thread #7: tid = 0x230fc1, 0x00000001990b3f48 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.root.default-qos', stop reason = breakpoint 1.1
frame #0: 0x00000001990b3f48 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000184500e90 CoreFoundation`+[NSException raise:format:] + 120
* frame #2: 0x00000001007f3f74 Parse`-[PFOfflineStore updateObjectIdForObject:oldObjectId:newObjectId:](self=0x0000000154e72df0, _cmd="updateObjectIdForObject:oldObjectId:newObjectId:", object=0x00000001560da370, oldObjectId=0x0000000000000000, newObjectId=@"Ya5KDVHpCg") + 516 at PFOfflineStore.m:957
frame #3: 0x00000001007bd754 Parse`-[PFObject _notifyObjectIdChangedFrom:toObjectId:](self=0x00000001560da370, _cmd="_notifyObjectIdChangedFrom:toObjectId:", fromObjectId=0x0000000000000000, toObjectId=@"Ya5KDVHpCg") + 260 at PFObject.m:1882
frame #4: 0x00000001007bd22c Parse`-[PFObject set_state:](self=0x00000001560da370, _cmd="set_state:", state=0x000000015622a320) + 456 at PFObject.m:1839
frame #
@hhanesand
hhanesand / generate_makefile.sh
Created September 8, 2015 13:09
Create makefile
rm GNUmakefile
touch GNUmakefile
echo -e 'include $(GNUSTEP_MAKEFILES)/common.make' >> GNUmakefile
echo -e "TOOL_NAME =" $1 "\n" >> GNUmakefile
echo -e "$1_OBJC_FILES = "$(find -name "*.m" | xargs) >> GNUmakefile
echo -e "$1_HEADER_FILES = "$(find -name "*.h" | xargs)"\n" >> GNUmakefile
echo -e "ADDITIONAL_CPPFLAGS = -Wall -Wno-import" >> GNUmakefile
echo 'include $(GNUSTEP_MAKEFILES)/tool.make' >> GNUmakefile
@hhanesand
hhanesand / deletelines.txt
Created August 10, 2015 13:04
Delete first 8 lines of a file with extension. Useful for deleting the copyright comments that xcode generates. In this case the NH is the file prefix and .h and .m are the accepted extensions.
find -regextype posix-extended -regex '.*?/NH.*?\.(h|m)' -exec sed -i -e '1,8d' {} \;
@hhanesand
hhanesand / gist:3747430b18d12c94fffe
Created March 27, 2015 02:28
PFQueryTableViewController subclass
@implementation GLQueryTableViewController
- (instancetype)initWithStyle:(UITableViewStyle)style localDatastoreTag:(NSString *)tag {
self.localDatastoreTag = tag;
return [self initWithStyle:style className:nil];
}
- (void)loadObjects:(NSInteger)page clear:(BOOL)clear {
NSAssert(!self.paginationEnabled, @"GLQueryTableViewController can not be used with pagination enabled.");