View gist:84fa68a373be22ef2737c0b3441ac94e
Process: Xcode [4032]
Path: /Applications/Xcode-beta.app/Contents/MacOS/Xcode
Identifier: Xcode
Version: 9.0 (13238.4)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [4032]
User ID: 501
Date/Time: 2017-08-28 10:28:44.078 +0200
View lldb
// iOS 11 (my iPad + iPhone)
(lldb) po UTTypeCopyDeclaration(kUTTypePDF)
{
UTTypeConformsTo = (
"public.data",
"public.composite-\U200bcontent"
);
UTTypeDescription = PDF;
UTTypeIdentifier = "com.adobe.pdf";
UTTypeTagSpecification = {
View PSPDFDefer.m
// Similar to defer in Swift
#define pspdf_defer_block_name_with_prefix(prefix, suffix) prefix ## suffix
#define pspdf_defer_block_name(suffix) pspdf_defer_block_name_with_prefix(pspdf_defer_, suffix)
#define pspdf_defer __strong void(^pspdf_defer_block_name(__LINE__))(void) __attribute__((cleanup(pspdf_defer_cleanup_block), unused)) = ^
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
static void pspdf_defer_cleanup_block(__strong void(^*block)(void)) {
(*block)();
}
#pragma clang diagnostic pop
View SpringboardDestroyer.swift
let badwork = { (queue: DispatchQueue) in
queue.async {
let app = UIApplication.shared
for index in 0..<100000 {
let name = "Yolo \(index)"
let identifier = app.beginBackgroundTask(withName: name, expirationHandler: {
print("Expired")
});
View PreviewCrash.crash
Process: Preview [25413]
Path: /Applications/Preview.app/Contents/MacOS/Preview
Identifier: com.apple.Preview
Version: 9.0 (909.18)
Build Info: Preview-909018000000000~1
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Preview [25413]
User ID: 501
View PSPDFFastEnumeration.h
//
// PSPDFFastEnumeration.h
// PSPDFFoundation
//
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps: https://pspdfkit.com.
// Try it today using our free PDF Viewer app: https://pdfviewer.io/
//
// This file is MIT licensed.
@protocol PSPDFFastEnumeration <NSFastEnumeration>
View PSPDFGenerics.h
//
// PSPDFGenerics.h
// PSPDFFoundation
//
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps: https://pspdfkit.com.
// Try it today using our free PDF Viewer app: https://pdfviewer.io/
//
// This file is MIT licensed.
/**
View PSPDF_KEYPATH.m
#define PSPDF_KEYPATH(object, property) (^{ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunreachable-code\"") \
_Pragma("clang diagnostic ignored \"-Wimplicit-retain-self\"") \
return ((void)(NO && ((void)object.property, NO)), @#property); \
_Pragma("clang diagnostic pop") \
}())
View gist:06d101d41c93763f7d5e394dea3c56fe
const NSUInteger test = 10u - 20u;
const NSInteger test2 = 10u - 20u;
const NSInteger test2_U = (NSUInteger)10 - (NSUInteger)20;
const NSUInteger test3 = 10 - 20;
const NSInteger test4 = 10 - 20;
const NSInteger test5 = 10u - 20;
64bit:
test NSUInteger 4294967286
test2 NSInteger 4294967286
View AvailailableAnalyzers
clang --version
Apple LLVM version 9.0.0 (clang-900.0.22.8)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang -cc1 -analyzer-checker-help
OVERVIEW: Clang Static Analyzer Checkers List
USAGE: -analyzer-checker <CHECKER or PACKAGE,...>