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
#!/bin/bash | |
# Generate a list of all* the frameworks' dependencies. Output to file to not blow out your scrollback | |
# * for an approximate definition of "all". There are a few it doesn't catch in PrivateFrameworks | |
cd /System/Library/Frameworks # or PrivateFrameworks, or /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks | |
for file in `ls` | |
do | |
fwkname=$(echo "$file" | cut -f 1 -d '.') | |
otool -L $file/$fwkname |
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
extension UInt8 : StringLiteralConvertible { | |
typealias ExtendedGraphemeClusterLiteralType = String | |
typealias UnicodeScalarLiteralType = String | |
public init(stringLiteral value: StringLiteralType){ | |
self.init(([UInt8]() + value.utf8)[0]) | |
} | |
public init(extendedGraphemeClusterLiteral value: String){ | |
self.init(([UInt8]() + value.utf8)[0]) |
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)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context | |
{ | |
BOOL isKVOBefore = NO; | |
Class realClass = object_getClass(self); | |
if (realClass != [self class]) //For more safety, parse the name, looking for the string "Autonotifying" | |
{ | |
isKVOBefore = YES; | |
} | |
if (!isKVONow) |
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
+ (id)objectForKeyedSubscript:(id)key | |
{ | |
unsigned int outCount; | |
if ([self instancesRespondToSelector:@selector(initWithCoder:)] && [key isKindOfClass:[NSCoder class]]) | |
{ | |
return [[self alloc] initWithCoder:key]; | |
} | |
//todo: cache these results in an associated object | |
Method *theseMethods = class_copyMethodList(self, &outCount); | |
NSMutableIndexSet *methodArrayHits = [[NSMutableIndexSet alloc] init]; |