This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lldb) bt | |
* thread #1: tid = 0x6e9f, 0x0036d774 PSPDFCatalog`-[PSPDFDebugLayer setNeedsLayout](self=0x1656a190, _cmd=0x302e001d) + 44 at PSPDFDebugHelper.m:456, queue = 'com.apple.main-thread', stop reason = breakpoint 14.1 | |
frame #0: 0x0036d774 PSPDFCatalog`-[PSPDFDebugLayer setNeedsLayout](self=0x1656a190, _cmd=0x302e001d) + 44 at PSPDFDebugHelper.m:456 | |
frame #1: 0x2f9763e8 QuartzCore`CA::Layer::property_did_change(CA::Transaction*, unsigned int) + 1188 | |
frame #2: 0x2f975f1c QuartzCore`CA::Layer::end_change(CA::Transaction*, unsigned int, objc_object*) + 64 | |
frame #3: 0x2f976a54 QuartzCore`CA::Layer::set_bounds(CA::Rect const&, bool) + 540 | |
frame #4: 0x2f976776 QuartzCore`-[CALayer setBounds:] + 110 | |
frame #5: 0x2f97789c QuartzCore`-[CALayer setFrame:] + 636 | |
frame #6: 0x2fcf6336 UIKit`-[UIView(Geometry) setFrame:] + 254 | |
frame #7: 0x2fd075f4 UIKit`-[UIView(Geometry) sizeToFit] + 304 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am steipete on github. | |
* I am steipete (https://keybase.io/steipete) on keybase. | |
* I have a public key whose fingerprint is 9876 AB22 6B7E 965A 8343 18AC 91F6 4410 6993 72A4 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code using the default allocator and callbacks now actually returns an NSArray (__NSArrayM), and no longer a toll-free-bridged object. | |
NSArray *test = CFBridgingRelease(CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks)); | |
NSArray *test3 = CFBridgingRelease(CFArrayCreate(kCFAllocatorDefault, NULL, 0, &kCFTypeArrayCallBacks)); | |
// This is custom and will always return __NSCFArray | |
NSArray *test2 = CFBridgingRelease(CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL)); | |
// This will return __NSArrayI. | |
NSArray *test4 = [NSArray array]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 64-bit helper from <tgmath.h> | |
// Extracted because those overrides won't work with Modules. | |
#undef fmin | |
#define fmin(__x, __y) __tg_fmin(__tg_promote2((__x), (__y))(__x), \ | |
__tg_promote2((__x), (__y))(__y)) | |
#undef fmax | |
#define fmax(__x, __y) __tg_fmax(__tg_promote2((__x), (__y))(__x), \ | |
__tg_promote2((__x), (__y))(__y)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void UIImagePickerEnsureViewIsInsidePopover(UIImagePickerController *self) { | |
if ([self isKindOfClass:UIImagePickerController.class]) { | |
// Ignore check on iPhone | |
if (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad) return; | |
// Ignore if property is set. | |
if ([[self _valueForProperty:@"_UIImagePickerControllerAllowAnySuperview"] boolValue]) return; | |
if (self.view.window && ![UIPopoverView popoverViewContainingView:self.view]) { | |
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"On iPad, %@ must be presented via UIPopoverController", NSStringFromClass(self.class)] userInfo:nil]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +[_UIPopoverView popoverViewContainingView:] looks similar to this: | |
static BOOL UIPopoverView_popoverViewContainingView(UIView *view ){ | |
do { | |
if ([view isKindOfClass:UIPopoverView.class]) return YES; | |
}while((view = view.superview)); | |
return NO; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add our own handler for didMoveToWindow. | |
[NSClassFromString(@"PLLibraryView") aspect_hookSelector:@selector(didMoveToWindow) withOptions:0 usingBlock:^(id instance, NSArray *arguments) { | |
// The lookup is ugly, but works well for this example. | |
UIImagePickerController *picker = instance; | |
while (picker && ![picker isKindOfClass:UIImagePickerController.class]) { | |
picker = (id)[picker nextResponder]; | |
} | |
PSUIImagePickerEnsureViewIsInsidePopover(imagePicker); | |
} error:NULL]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testRelativeURLs { | |
PSPDFDocument *document = [[PSPDFTestAssetLoader new] documentWithName:@"Testcase-relative-links.pdf"]; | |
NSArray *annotations = [document annotationsForPage:0 type:PSPDFAnnotationTypeLink]; | |
PSPDFLinkAnnotation *link = annotations[0]; | |
NSString *const referenceString = @"Testcase-relative-links/Simple.txt"; | |
XCTAssertEqualObjects(link.URL.absoluteString, referenceString, @"URL should be correct"); | |
PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:document]; | |
__block NSURL *showPreviewURL = nil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testSparkInspectorCompatibility { | |
PSPDFDocument *document = [[PSPDFTestAssetLoader new] documentWithName:@"Testcase_Metadata.pdf"]; | |
// Spark swizzles this method and calls description on the target. Let's simulate this for this test case, and then clean up. | |
id<Aspect> token = [NSNotificationCenter aspect_hookSelector:@selector(addObserver:selector:name:object:) withOptions:0 usingBlock:^(id instance, NSArray *args) { | |
[args.firstObject description]; | |
} error:NULL]; | |
// Load the document. This failed because of side effects in description when called during init. | |
UIImage *image = [document imageForPage:0 size:CGSizeMake(100, 100) clippedToRect:CGRectZero annotations:nil options:nil receipt:NULL error:NULL]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lldb) po [[[UIApplication sharedApplication] delegate] _shortMethodDescription] | |
<NSObject: 0x10c930450>: | |
in NSObject: | |
Class Methods: | |
+ (id) aspect_hookSelector:(SEL)arg1 withOptions:(unsigned long)arg2 usingBlock:(id)arg3 error:(id*)arg4; (0x10e669fb0) | |
+ (void) performSelectorWithNonRetainedTarget:(id)arg1 selector:(SEL)arg2 withObject:(id)arg3 afterDelay:(double)arg4; (0x10046e7fc) | |
+ (void) cancelPreviousPerformRequestsWithNonRetainedTarget:(id)arg1 selector:(SEL)arg2 object:(id)arg3; (0x10046e866) | |
+ (void) cancelPreviousPerformRequestsWithNonRetainedTarget:(id)arg1; (0x10046ead2) | |
+ (id) replacementObjectForPortCoder:(id)arg1; (0x10130bc73) | |
+ (objc_method_description*) instanceMethodDescriptionForSelector:(SEL)arg1; (0x1012dc040) |
OlderNewer