Skip to content

Instantly share code, notes, and snippets.

- (void)_checkCacheOrFail:(RNCachedData *)cache
{
if (cache)
{
NSHTTPURLResponse* response = (NSHTTPURLResponse *)[cache response];
NSURLRequest* redirectRequest = [cache redirectRequest];
if (redirectRequest)
{
GuardMalloc[ConciseEvents-2892]: Tried to free pointer at 0xdc16cdd0 in zone GuardMalloc-DefaultMallocZone which is not currently a pointer to a malloc buffer.
(lldb) po self
(RNCachingURLProtocol *) $2 = 0xdbd44fe0 <RNCachingURLProtocol: 0xdbd44fe0>
* thread #6: tid = 0x2503, 0x90c65adb libsystem_c.dylib`pthread_kill + 113, stop reason = instruction step into
frame #0: 0x90c65adb libsystem_c.dylib`pthread_kill + 113
frame #1: 0x90c9c4f8 libsystem_c.dylib`abort + 168
frame #2: 0x000bd304 libgmalloc.dylib`GuardMalloc_free + 103
frame #3: 0x046a2b08 CoreFoundation`__CFAllocatorSystemDeallocate + 24
frame #4: 0x046a2ada CoreFoundation`CFAllocatorDeallocate + 138
- (void)testSignupARandomUser
{
__block BOOL finished = NO;
NSString* userName = RANDOM_STRING;
NSString* name = RANDOM_STRING;
NSString* email = [NSString stringWithFormat:@"%@@me.com", userName];
NSString* password = RANDOM_STRING;
NSString* profilePicPath = [[NSBundle bundleForClass:[PLGConfiguration class]] pathForResource:@"matt" ofType:@"jpg"];
NSData* profilePicData = [NSData dataWithContentsOfFile:profilePicPath];
[audioReader startReading];
// Go back to the beginning of the video to append the audio
[videoWriter startSessionAtSourceTime:kCMTimeZero];
// Get the next block of date of the audio
CMSampleBufferRef sample;
// Keep appending the audio as it becomes ready
while ((sample = [readerOutput copyNextSampleBuffer]))
- (void)_processAudio:(AVURLAsset *)audioAsset
present:(NSString *)preset
handler:(void(^)(double percentComplete, NSError* error))handler
{
NSString* tempDir = NSTemporaryDirectory();
NSString* exportPath = [tempDir stringByAppendingPathComponent:[NSString randomString]];
if ([[NSFileManager defaultManager] fileExistsAtPath:exportPath])
{
[[NSFileManager defaultManager] removeItemAtPath:exportPath
//
// NSObject+PLGSubscripting.h
// polligraf
//
// Created by Matthew Wilkinson on 31/07/2012.
// Copyright (c) 2012 fuerte international. All rights reserved.
//
#import <Foundation/Foundation.h>
{
email = "[email protected]";
name = "4318B3A0-DB84-4B1E-80A1-B8EE9D0D57C4";
password = "CEB48A53-80DF-4B8C-BF80-12955F0CF6EF";
profilePic = "/9j/4AAQSkZJRgABAgAAAQABAAD//gAEKgD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAEZCAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWiAAAAAAAAADFgAAAzMAAAKkWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAAaAAAAywHJA2MFkghrC/YQPxVRGzQh8SmQMhg7kkYFUXdd7WtwegWJsZp8rGm/fdPD6TD////bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk
- (void)_failWithConnectionError:(void(^)(NSError *error, NSDictionary *responseInfo))completion
caller:(dispatch_queue_t)caller
{
NSParameterAssert(completion);
if (dispatch_get_current_queue() == caller)
{
completion([NSError errorWithDomain:ERROR_DOMAIN
code:kConnectionError
userInfo:nil], nil);
- (void)testAPIValidateCredentialsWithGoodData
{
NSLog(@"Starting testAPIValidateCredentialsWithGoodData");
__block BOOL finished = NO;
[PLGDATA validateCredentials:@{ @"email" : @"testAccount1",
@"password" : @"testAccount1" }
completion:^(NSError *error, NSDictionary *responseInfo) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
@interface NSObject (PLGSubscripting)
- (id)objectAtIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
- (id)objectForKeyedSubscript:(id)key;
@end