diff --git a/TypeExtensions.xcodeproj/project.pbxproj b/TypeExtensions.xcodeproj/project.pbxproj index f266a91..3f9f6bc 100644 --- a/TypeExtensions.xcodeproj/project.pbxproj +++ b/TypeExtensions.xcodeproj/project.pbxproj @@ -20,83 +20,85 @@ 42026AEB183EA07900B1F530 /* TypeExtensionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CC9183E8EA400967368 /* TypeExtensionsTests.m */; }; 42026AEC183EA16500B1F530 /* TypeExtensions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 420D1A9C165BF5020097EE03 /* TypeExtensions.framework */; }; 4202873316CC241600F2C92A /* NSString+dateValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4202873116CC241600F2C92A /* NSString+dateValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4202873416CC241600F2C92A /* NSString+dateValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4202873216CC241600F2C92A /* NSString+dateValue.m */; }; 4202873716CC245E00F2C92A /* NSDate+stringValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4202873516CC245E00F2C92A /* NSDate+stringValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4202873816CC245E00F2C92A /* NSDate+stringValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4202873616CC245E00F2C92A /* NSDate+stringValue.m */; }; 420D1AA0165BF5020097EE03 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 420D1A9F165BF5020097EE03 /* Cocoa.framework */; }; 420D1AAA165BF5020097EE03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 420D1AA8165BF5020097EE03 /* InfoPlist.strings */; }; 420D1AC6165BF54D0097EE03 /* NSArray+orNull.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AB5165BF54D0097EE03 /* NSArray+orNull.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1AC7165BF54D0097EE03 /* NSArray+orNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AB6165BF54D0097EE03 /* NSArray+orNull.m */; }; 420D1AC8165BF54D0097EE03 /* NSObject+isNull.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AB7165BF54D0097EE03 /* NSObject+isNull.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1AC9165BF54D0097EE03 /* NSObject+isNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AB8165BF54D0097EE03 /* NSObject+isNull.m */; }; 420D1ACA165BF54D0097EE03 /* NSString+isEmpty.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AB9165BF54D0097EE03 /* NSString+isEmpty.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1ACB165BF54D0097EE03 /* NSString+isEmpty.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1ABA165BF54D0097EE03 /* NSString+isEmpty.m */; }; 420D1ACC165BF54D0097EE03 /* NSDictionary+plistValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1ABC165BF54D0097EE03 /* NSDictionary+plistValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1ACD165BF54D0097EE03 /* NSDictionary+plistValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1ABD165BF54D0097EE03 /* NSDictionary+plistValue.m */; }; 420D1ACE165BF54D0097EE03 /* NSString+dataValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1ABE165BF54D0097EE03 /* NSString+dataValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1ACF165BF54D0097EE03 /* NSString+dataValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1ABF165BF54D0097EE03 /* NSString+dataValue.m */; }; 420D1AD0165BF54D0097EE03 /* NSString+isNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AC0165BF54D0097EE03 /* NSString+isNumber.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1AD1165BF54D0097EE03 /* NSString+isNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AC1165BF54D0097EE03 /* NSString+isNumber.m */; }; 420D1AD2165BF54D0097EE03 /* NSString+numberValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AC2165BF54D0097EE03 /* NSString+numberValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1AD3165BF54D0097EE03 /* NSString+numberValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AC3165BF54D0097EE03 /* NSString+numberValue.m */; }; 420D1AD4165BF54D0097EE03 /* NSString+plistValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AC4165BF54D0097EE03 /* NSString+plistValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 420D1AD5165BF54D0097EE03 /* NSString+plistValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AC5165BF54D0097EE03 /* NSString+plistValue.m */; }; 42352D3518765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.h in Headers */ = {isa = PBXBuildFile; fileRef = 42352D3318765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42352D3618765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.m in Sources */ = {isa = PBXBuildFile; fileRef = 42352D3418765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.m */; }; + 42352D6A1877E4AF0011CA48 /* NSDictionary+entrySet.m in Sources */ = {isa = PBXBuildFile; fileRef = 42719C5D17C93855007AAB83 /* NSDictionary+entrySet.m */; }; + 42352D6B1877E4AF0011CA48 /* NSMapTable+objectForKeyedSubscript.m in Sources */ = {isa = PBXBuildFile; fileRef = 42352D3418765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.m */; }; + 42352D6E1877E4AF0011CA48 /* NSObject+abstractClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307DB17C932F50045A398 /* NSObject+abstractClass.m */; }; + 42352D6F1877E4AF0011CA48 /* NSObject+abstractProtocolConformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307DD17C932F50045A398 /* NSObject+abstractProtocolConformer.m */; }; + 42352D701877E4AF0011CA48 /* NSObject+supersequentImplementation.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307DF17C932F50045A398 /* NSObject+supersequentImplementation.m */; }; + 42352D711877E4AF0011CA48 /* NSObject_Singleton.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E117C932F50045A398 /* NSObject_Singleton.m */; }; + 42352D721877E4AF0011CA48 /* NSNull+nullForProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E417C932F50045A398 /* NSNull+nullForProtocol.m */; }; + 42352D731877E4AF0011CA48 /* NSObject+methodDescriptionForSelectorInProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E617C932F50045A398 /* NSObject+methodDescriptionForSelectorInProtocol.m */; }; + 42352D741877E4AF0011CA48 /* NSObject_ProtocolConformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E817C932F50045A398 /* NSObject_ProtocolConformer.m */; }; + 42352D751877E4AF0011CA48 /* NSString+characterAtIndexSubscript.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307EB17C932F50045A398 /* NSString+characterAtIndexSubscript.m */; }; + 42352D761877E4AF0011CA48 /* NSString+firstLetterCaseString.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307ED17C932F50045A398 /* NSString+firstLetterCaseString.m */; }; + 42352D771877E4AF0011CA48 /* NSString+isEqualToStringIgnoreCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307EF17C932F50045A398 /* NSString+isEqualToStringIgnoreCase.m */; }; + 42352D781877E4AF0011CA48 /* NSString+random.m in Sources */ = {isa = PBXBuildFile; fileRef = 42719C6B17C93B66007AAB83 /* NSString+random.m */; }; + 42352D791877E4AF0011CA48 /* NSNotificationCenter+errorCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 428D034018482D9500303ED4 /* NSNotificationCenter+errorCenter.m */; }; + 42352D7A1877E4AF0011CA48 /* NSObject+isNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AB8165BF54D0097EE03 /* NSObject+isNull.m */; }; + 42352D7B1877E4AF0011CA48 /* NSString+isEmpty.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1ABA165BF54D0097EE03 /* NSString+isEmpty.m */; }; + 42352D7C1877E4AF0011CA48 /* NSArray+orNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AB6165BF54D0097EE03 /* NSArray+orNull.m */; }; + 42352D7D1877E4AF0011CA48 /* NSString+orNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 4291FF3716C57EA4000538EF /* NSString+orNull.m */; }; + 42352D7E1877E4AF0011CA48 /* NSObject_KVCArrayForwarding.m in Sources */ = {isa = PBXBuildFile; fileRef = 428D034618482DA700303ED4 /* NSObject_KVCArrayForwarding.m */; }; + 42352D7F1877E4AF0011CA48 /* NSObject_KVCUndefined.m in Sources */ = {isa = PBXBuildFile; fileRef = 428D034818482DA700303ED4 /* NSObject_KVCUndefined.m */; }; + 42352D801877E4AF0011CA48 /* NSString+isNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AC1165BF54D0097EE03 /* NSString+isNumber.m */; }; + 42352D811877E4AF0011CA48 /* NSString+urlValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BA0C3416707B2C0066DD1A /* NSString+urlValue.m */; }; + 42352D821877E4AF0011CA48 /* NSString+numberValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AC3165BF54D0097EE03 /* NSString+numberValue.m */; }; + 42352D831877E4AF0011CA48 /* NSString+dataValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1ABF165BF54D0097EE03 /* NSString+dataValue.m */; }; + 42352D841877E4AF0011CA48 /* NSData+stringValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFF306165DFBE6003F26DA /* NSData+stringValue.m */; }; + 42352D851877E4AF0011CA48 /* NSString+plistValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1AC5165BF54D0097EE03 /* NSString+plistValue.m */; }; + 42352D861877E4AF0011CA48 /* NSDictionary+plistValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D1ABD165BF54D0097EE03 /* NSDictionary+plistValue.m */; }; + 42352D871877E4AF0011CA48 /* NSString+dateValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4202873216CC241600F2C92A /* NSString+dateValue.m */; }; + 42352D881877E4AF0011CA48 /* NSDate+stringValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4202873616CC245E00F2C92A /* NSDate+stringValue.m */; }; + 42352D891877E4AF0011CA48 /* NSObject+associatedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CA6183DAC4100967368 /* NSObject+associatedObject.m */; }; + 42352D8B1877E4AF0011CA48 /* NSObject+invocationForSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CAA183DAC4100967368 /* NSObject+invocationForSelector.m */; }; + 42352D8C1877E4AF0011CA48 /* NSObject+invokeSafely.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CB9183DB08900967368 /* NSObject+invokeSafely.m */; }; 42719C5317C935A6007AAB83 /* Design.h in Headers */ = {isa = PBXBuildFile; fileRef = 42719C5117C9343C007AAB83 /* Design.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42719C5417C935A9007AAB83 /* Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 42719C5017C933F8007AAB83 /* Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42719C5517C935AB007AAB83 /* String.h in Headers */ = {isa = PBXBuildFile; fileRef = 42719C4F17C933AC007AAB83 /* String.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42719C6017C93855007AAB83 /* NSDictionary+entrySet.h in Headers */ = {isa = PBXBuildFile; fileRef = 42719C5C17C93855007AAB83 /* NSDictionary+entrySet.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42719C6117C93855007AAB83 /* NSDictionary+entrySet.m in Sources */ = {isa = PBXBuildFile; fileRef = 42719C5D17C93855007AAB83 /* NSDictionary+entrySet.m */; }; 42719C6517C9386A007AAB83 /* Collection.h in Headers */ = {isa = PBXBuildFile; fileRef = 42719C6417C9386A007AAB83 /* Collection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42719C6C17C93B66007AAB83 /* NSString+random.h in Headers */ = {isa = PBXBuildFile; fileRef = 42719C6A17C93B66007AAB83 /* NSString+random.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42719C6D17C93B66007AAB83 /* NSString+random.m in Sources */ = {isa = PBXBuildFile; fileRef = 42719C6B17C93B66007AAB83 /* NSString+random.m */; }; 427307F017C932F50045A398 /* NSObject+abstractClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307DA17C932F50045A398 /* NSObject+abstractClass.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307F117C932F50045A398 /* NSObject+abstractClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307DB17C932F50045A398 /* NSObject+abstractClass.m */; }; 427307F217C932F50045A398 /* NSObject+abstractProtocolConformer.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307DC17C932F50045A398 /* NSObject+abstractProtocolConformer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307F317C932F50045A398 /* NSObject+abstractProtocolConformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307DD17C932F50045A398 /* NSObject+abstractProtocolConformer.m */; }; 427307F417C932F50045A398 /* NSObject+supersequentImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307DE17C932F50045A398 /* NSObject+supersequentImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307F517C932F50045A398 /* NSObject+supersequentImplementation.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307DF17C932F50045A398 /* NSObject+supersequentImplementation.m */; }; 427307F617C932F50045A398 /* NSObject_Singleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307E017C932F50045A398 /* NSObject_Singleton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307F717C932F50045A398 /* NSObject_Singleton.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E117C932F50045A398 /* NSObject_Singleton.m */; }; 427307F817C932F50045A398 /* NSNull+nullForProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307E317C932F50045A398 /* NSNull+nullForProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307F917C932F50045A398 /* NSNull+nullForProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E417C932F50045A398 /* NSNull+nullForProtocol.m */; }; 427307FA17C932F50045A398 /* NSObject+methodDescriptionForSelectorInProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307E517C932F50045A398 /* NSObject+methodDescriptionForSelectorInProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307FB17C932F50045A398 /* NSObject+methodDescriptionForSelectorInProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E617C932F50045A398 /* NSObject+methodDescriptionForSelectorInProtocol.m */; }; 427307FC17C932F50045A398 /* NSObject_ProtocolConformer.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307E717C932F50045A398 /* NSObject_ProtocolConformer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307FD17C932F50045A398 /* NSObject_ProtocolConformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307E817C932F50045A398 /* NSObject_ProtocolConformer.m */; }; 427307FE17C932F50045A398 /* NSString+characterAtIndexSubscript.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307EA17C932F50045A398 /* NSString+characterAtIndexSubscript.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 427307FF17C932F50045A398 /* NSString+characterAtIndexSubscript.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307EB17C932F50045A398 /* NSString+characterAtIndexSubscript.m */; }; 4273080017C932F50045A398 /* NSString+firstLetterCaseString.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307EC17C932F50045A398 /* NSString+firstLetterCaseString.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4273080117C932F50045A398 /* NSString+firstLetterCaseString.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307ED17C932F50045A398 /* NSString+firstLetterCaseString.m */; }; 4273080217C932F50045A398 /* NSString+isEqualToStringIgnoreCase.h in Headers */ = {isa = PBXBuildFile; fileRef = 427307EE17C932F50045A398 /* NSString+isEqualToStringIgnoreCase.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4273080317C932F50045A398 /* NSString+isEqualToStringIgnoreCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 427307EF17C932F50045A398 /* NSString+isEqualToStringIgnoreCase.m */; }; 42877CAF183DAC4100967368 /* Misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 42877CA4183DAC4100967368 /* Misc.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42877CB0183DAC4100967368 /* NSObject+associatedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 42877CA5183DAC4100967368 /* NSObject+associatedObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42877CB1183DAC4100967368 /* NSObject+associatedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CA6183DAC4100967368 /* NSObject+associatedObject.m */; }; 42877CB4183DAC4100967368 /* NSObject+invocationForSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 42877CA9183DAC4100967368 /* NSObject+invocationForSelector.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42877CB5183DAC4100967368 /* NSObject+invocationForSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CAA183DAC4100967368 /* NSObject+invocationForSelector.m */; }; 42877CBA183DB08900967368 /* NSObject+invokeSafely.h in Headers */ = {isa = PBXBuildFile; fileRef = 42877CB8183DB08900967368 /* NSObject+invokeSafely.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42877CBB183DB08900967368 /* NSObject+invokeSafely.m in Sources */ = {isa = PBXBuildFile; fileRef = 42877CB9183DB08900967368 /* NSObject+invokeSafely.m */; }; 428D034118482D9500303ED4 /* Notification.h in Headers */ = {isa = PBXBuildFile; fileRef = 428D033E18482D9500303ED4 /* Notification.h */; settings = {ATTRIBUTES = (Public, ); }; }; 428D034218482D9500303ED4 /* NSNotificationCenter+errorCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 428D033F18482D9500303ED4 /* NSNotificationCenter+errorCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 428D034318482D9500303ED4 /* NSNotificationCenter+errorCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 428D034018482D9500303ED4 /* NSNotificationCenter+errorCenter.m */; }; 428D034918482DA700303ED4 /* KVC.h in Headers */ = {isa = PBXBuildFile; fileRef = 428D034418482DA700303ED4 /* KVC.h */; settings = {ATTRIBUTES = (Public, ); }; }; 428D034A18482DA700303ED4 /* NSObject_KVCArrayForwarding.h in Headers */ = {isa = PBXBuildFile; fileRef = 428D034518482DA700303ED4 /* NSObject_KVCArrayForwarding.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 428D034B18482DA700303ED4 /* NSObject_KVCArrayForwarding.m in Sources */ = {isa = PBXBuildFile; fileRef = 428D034618482DA700303ED4 /* NSObject_KVCArrayForwarding.m */; }; 428D034C18482DA700303ED4 /* NSObject_KVCUndefined.h in Headers */ = {isa = PBXBuildFile; fileRef = 428D034718482DA700303ED4 /* NSObject_KVCUndefined.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 428D034D18482DA700303ED4 /* NSObject_KVCUndefined.m in Sources */ = {isa = PBXBuildFile; fileRef = 428D034818482DA700303ED4 /* NSObject_KVCUndefined.m */; }; 4290F08C1849A31400C67769 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 4290F08A1849A31400C67769 /* LICENSE */; }; 4290F08D1849A31400C67769 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 4290F08B1849A31400C67769 /* README.md */; }; 4291FF3816C57EA4000538EF /* NSString+orNull.h in Headers */ = {isa = PBXBuildFile; fileRef = 4291FF3616C57EA4000538EF /* NSString+orNull.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4291FF3916C57EA4000538EF /* NSString+orNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 4291FF3716C57EA4000538EF /* NSString+orNull.m */; }; + 429CE069188F682C00FF0113 /* TXWeakProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 429CE067188F682C00FF0113 /* TXWeakProxy.h */; }; + 429CE06A188F682C00FF0113 /* TXWeakProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 429CE068188F682C00FF0113 /* TXWeakProxy.m */; }; 42AC0B19165CA0B2002E846E /* Null.h in Headers */ = {isa = PBXBuildFile; fileRef = 42AC0B16165C9FBB002E846E /* Null.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42AC0B1B165CA111002E846E /* TypeExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 420D1AAC165BF5020097EE03 /* TypeExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42BA0C3516707B2C0066DD1A /* NSString+urlValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 42BA0C3316707B2C0066DD1A /* NSString+urlValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42BA0C3616707B2C0066DD1A /* NSString+urlValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BA0C3416707B2C0066DD1A /* NSString+urlValue.m */; }; 42D8076016CE206A002885D0 /* Value.h in Headers */ = {isa = PBXBuildFile; fileRef = 4202873016CC23F900F2C92A /* Value.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42DFF307165DFBE6003F26DA /* NSData+stringValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 42DFF305165DFBE6003F26DA /* NSData+stringValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 42DFF308165DFBE6003F26DA /* NSData+stringValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFF306165DFBE6003F26DA /* NSData+stringValue.m */; }; 42EC2955183F115800AA5BDA /* Dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 42EC2954183F115800AA5BDA /* Dummy.m */; }; /* End PBXBuildFile section */ @@ -206,6 +208,8 @@ 4290F08E1849A32600C67769 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; }; 4291FF3616C57EA4000538EF /* NSString+orNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+orNull.h"; sourceTree = ""; }; 4291FF3716C57EA4000538EF /* NSString+orNull.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+orNull.m"; sourceTree = ""; }; + 429CE067188F682C00FF0113 /* TXWeakProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TXWeakProxy.h; sourceTree = ""; }; + 429CE068188F682C00FF0113 /* TXWeakProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TXWeakProxy.m; sourceTree = ""; }; 42AC0B16165C9FBB002E846E /* Null.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Null.h; sourceTree = ""; }; 42BA0C3316707B2C0066DD1A /* NSString+urlValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+urlValue.h"; sourceTree = ""; }; 42BA0C3416707B2C0066DD1A /* NSString+urlValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+urlValue.m"; sourceTree = ""; }; @@ -454,6 +458,8 @@ 42877CAA183DAC4100967368 /* NSObject+invocationForSelector.m */, 42877CB8183DB08900967368 /* NSObject+invokeSafely.h */, 42877CB9183DB08900967368 /* NSObject+invokeSafely.m */, + 429CE067188F682C00FF0113 /* TXWeakProxy.h */, + 429CE068188F682C00FF0113 /* TXWeakProxy.m */, ); path = "Other Extensions"; sourceTree = ""; @@ -528,6 +534,7 @@ 42877CB0183DAC4100967368 /* NSObject+associatedObject.h in Headers */, 42877CB4183DAC4100967368 /* NSObject+invocationForSelector.h in Headers */, 42352D3518765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.h in Headers */, + 429CE069188F682C00FF0113 /* TXWeakProxy.h in Headers */, 42877CBA183DB08900967368 /* NSObject+invokeSafely.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -560,7 +567,7 @@ 420D1A97165BF5020097EE03 /* Sources */, 420D1A98165BF5020097EE03 /* Frameworks */, 420D1A99165BF5020097EE03 /* Headers */, - 42352D481877C9A20011CA48 /* ShellScript */, + 42352D481877C9A20011CA48 /* Update Build Number */, 420D1A9A165BF5020097EE03 /* Resources */, ); buildRules = ( @@ -625,18 +632,20 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 42352D481877C9A20011CA48 /* ShellScript */ = { + 42352D481877C9A20011CA48 /* Update Build Number */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); + name = "Update Build Number"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "buildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"$INFOPLIST_FILE\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"$INFOPLIST_FILE\""; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -663,38 +672,39 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 42719C6117C93855007AAB83 /* NSDictionary+entrySet.m in Sources */, - 427307F117C932F50045A398 /* NSObject+abstractClass.m in Sources */, - 427307F317C932F50045A398 /* NSObject+abstractProtocolConformer.m in Sources */, - 427307F517C932F50045A398 /* NSObject+supersequentImplementation.m in Sources */, - 427307F717C932F50045A398 /* NSObject_Singleton.m in Sources */, - 427307F917C932F50045A398 /* NSNull+nullForProtocol.m in Sources */, - 427307FB17C932F50045A398 /* NSObject+methodDescriptionForSelectorInProtocol.m in Sources */, - 427307FD17C932F50045A398 /* NSObject_ProtocolConformer.m in Sources */, - 427307FF17C932F50045A398 /* NSString+characterAtIndexSubscript.m in Sources */, - 4273080117C932F50045A398 /* NSString+firstLetterCaseString.m in Sources */, - 42352D3618765FFA0011CA48 /* NSMapTable+objectForKeyedSubscript.m in Sources */, - 4273080317C932F50045A398 /* NSString+isEqualToStringIgnoreCase.m in Sources */, - 42719C6D17C93B66007AAB83 /* NSString+random.m in Sources */, - 428D034318482D9500303ED4 /* NSNotificationCenter+errorCenter.m in Sources */, - 420D1AC9165BF54D0097EE03 /* NSObject+isNull.m in Sources */, - 420D1ACB165BF54D0097EE03 /* NSString+isEmpty.m in Sources */, - 420D1AC7165BF54D0097EE03 /* NSArray+orNull.m in Sources */, - 4291FF3916C57EA4000538EF /* NSString+orNull.m in Sources */, - 428D034B18482DA700303ED4 /* NSObject_KVCArrayForwarding.m in Sources */, - 428D034D18482DA700303ED4 /* NSObject_KVCUndefined.m in Sources */, - 420D1AD1165BF54D0097EE03 /* NSString+isNumber.m in Sources */, - 42BA0C3616707B2C0066DD1A /* NSString+urlValue.m in Sources */, - 420D1AD3165BF54D0097EE03 /* NSString+numberValue.m in Sources */, - 420D1ACF165BF54D0097EE03 /* NSString+dataValue.m in Sources */, - 42DFF308165DFBE6003F26DA /* NSData+stringValue.m in Sources */, - 420D1AD5165BF54D0097EE03 /* NSString+plistValue.m in Sources */, - 420D1ACD165BF54D0097EE03 /* NSDictionary+plistValue.m in Sources */, - 4202873416CC241600F2C92A /* NSString+dateValue.m in Sources */, - 4202873816CC245E00F2C92A /* NSDate+stringValue.m in Sources */, - 42877CB1183DAC4100967368 /* NSObject+associatedObject.m in Sources */, - 42877CB5183DAC4100967368 /* NSObject+invocationForSelector.m in Sources */, - 42877CBB183DB08900967368 /* NSObject+invokeSafely.m in Sources */, + 42352D6A1877E4AF0011CA48 /* NSDictionary+entrySet.m in Sources */, + 42352D6B1877E4AF0011CA48 /* NSMapTable+objectForKeyedSubscript.m in Sources */, + 42352D6E1877E4AF0011CA48 /* NSObject+abstractClass.m in Sources */, + 42352D6F1877E4AF0011CA48 /* NSObject+abstractProtocolConformer.m in Sources */, + 42352D701877E4AF0011CA48 /* NSObject+supersequentImplementation.m in Sources */, + 42352D711877E4AF0011CA48 /* NSObject_Singleton.m in Sources */, + 42352D721877E4AF0011CA48 /* NSNull+nullForProtocol.m in Sources */, + 42352D731877E4AF0011CA48 /* NSObject+methodDescriptionForSelectorInProtocol.m in Sources */, + 42352D741877E4AF0011CA48 /* NSObject_ProtocolConformer.m in Sources */, + 42352D751877E4AF0011CA48 /* NSString+characterAtIndexSubscript.m in Sources */, + 42352D761877E4AF0011CA48 /* NSString+firstLetterCaseString.m in Sources */, + 42352D771877E4AF0011CA48 /* NSString+isEqualToStringIgnoreCase.m in Sources */, + 42352D781877E4AF0011CA48 /* NSString+random.m in Sources */, + 42352D791877E4AF0011CA48 /* NSNotificationCenter+errorCenter.m in Sources */, + 42352D7A1877E4AF0011CA48 /* NSObject+isNull.m in Sources */, + 42352D7B1877E4AF0011CA48 /* NSString+isEmpty.m in Sources */, + 42352D7C1877E4AF0011CA48 /* NSArray+orNull.m in Sources */, + 429CE06A188F682C00FF0113 /* TXWeakProxy.m in Sources */, + 42352D7D1877E4AF0011CA48 /* NSString+orNull.m in Sources */, + 42352D7E1877E4AF0011CA48 /* NSObject_KVCArrayForwarding.m in Sources */, + 42352D7F1877E4AF0011CA48 /* NSObject_KVCUndefined.m in Sources */, + 42352D801877E4AF0011CA48 /* NSString+isNumber.m in Sources */, + 42352D811877E4AF0011CA48 /* NSString+urlValue.m in Sources */, + 42352D821877E4AF0011CA48 /* NSString+numberValue.m in Sources */, + 42352D831877E4AF0011CA48 /* NSString+dataValue.m in Sources */, + 42352D841877E4AF0011CA48 /* NSData+stringValue.m in Sources */, + 42352D851877E4AF0011CA48 /* NSString+plistValue.m in Sources */, + 42352D861877E4AF0011CA48 /* NSDictionary+plistValue.m in Sources */, + 42352D871877E4AF0011CA48 /* NSString+dateValue.m in Sources */, + 42352D881877E4AF0011CA48 /* NSDate+stringValue.m in Sources */, + 42352D891877E4AF0011CA48 /* NSObject+associatedObject.m in Sources */, + 42352D8B1877E4AF0011CA48 /* NSObject+invocationForSelector.m in Sources */, + 42352D8C1877E4AF0011CA48 /* NSObject+invokeSafely.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -835,6 +845,7 @@ 420D1AB2165BF5020097EE03 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -850,6 +861,7 @@ 420D1AB3165BF5020097EE03 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; diff --git a/TypeExtensions/Collection Extensions/NSDictionary+entrySet.m b/TypeExtensions/Collection Extensions/NSDictionary+entrySet.m index 30385a7..2582def 100644 --- a/TypeExtensions/Collection Extensions/NSDictionary+entrySet.m +++ b/TypeExtensions/Collection Extensions/NSDictionary+entrySet.m @@ -37,24 +37,18 @@ @implementation __NSDictionaryEntry + (instancetype)dictionaryEntryWithKey:(id)key forDictionary:(NSDictionary *)dictionary { - return [[[self alloc] initWithKey:key forDictionary:dictionary] autorelease]; + return [[self alloc] initWithKey:key forDictionary:dictionary]; } - (id)initWithKey:(id)key forDictionary:(NSDictionary *)dictionary { if (self = [super init]) { - _key = [key retain]; - _object = [dictionary[key] retain]; + _key = key; + _object = dictionary[key]; } return self; } -- (void)dealloc -{ - [_key release]; - [_object release]; - [super dealloc]; -} - (NSString *)description { diff --git a/TypeExtensions/Design Pattern Extensions/NSObject+abstractProtocolConformer.m b/TypeExtensions/Design Pattern Extensions/NSObject+abstractProtocolConformer.m index 901776f..9f8a1bd 100644 --- a/TypeExtensions/Design Pattern Extensions/NSObject+abstractProtocolConformer.m +++ b/TypeExtensions/Design Pattern Extensions/NSObject+abstractProtocolConformer.m @@ -15,14 +15,26 @@ #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" @implementation NSObject (abstractProtocolConformer) + - (void)doesNotRecognizeSelector:(SEL)aSelector { - unsigned int count = 0; - Protocol ** protocols = class_copyProtocolList([self class], &count); - for (unsigned int i = 0; i < count; i++) - if (!isNullMethodDescription([[self class] methodDescriptionForSelector:aSelector inProtocol:protocols[i]])) - @throw [[self class] _subclassImplementationExceptionFromMethod:aSelector isClassMethod:NO]; + Class class = self.class; + + do { + unsigned int count = 0, i; + Protocol * __unsafe_unretained * list = class_copyProtocolList(class, &count); + + for (i = 0; i < count; i++) + if (!isNullMethodDescription([class methodDescriptionForSelector:aSelector inProtocol:list[i]])) + goto throw; + + free(list); + } while ((class = class.superclass)); + __supersInvoke(aSelector); + +throw: + @throw [[self class] _subclassImplementationExceptionFromMethod:aSelector isClassMethod:NO]; } @end diff --git a/TypeExtensions/Design Pattern Extensions/NSObject_Singleton.m b/TypeExtensions/Design Pattern Extensions/NSObject_Singleton.m index 5e88a2b..d035528 100644 --- a/TypeExtensions/Design Pattern Extensions/NSObject_Singleton.m +++ b/TypeExtensions/Design Pattern Extensions/NSObject_Singleton.m @@ -8,11 +8,20 @@ #import "NSObject_Singleton.h" +#import "NSObject+associatedObject.h" + +#define kSingletonKey "com.firelizzard.TypeExtensions.Misc.Singleton.key" + @implementation NSObject_Singleton + (id)sharedInstance { - return [[super allocWithZone:NULL] init]; + id shared = [self associatedObjectForKey:kSingletonKey]; + + if (!shared) + [self setAssociatedObject:(shared = [[super allocWithZone:NULL] init]) forKey:kSingletonKey]; + + return shared; } + (id)allocWithZone:(NSZone *)zone @@ -24,19 +33,4 @@ - (id)copyWithZone:(NSZone *)zone { return self; } -- (id)retain -{ - return self; -} - -- (id)autorelease -{ - return self; -} - -- (oneway void)release -{ - // don't release -} - @end diff --git a/TypeExtensions/KVC Extensions/NSObject_KVCArrayForwarding.m b/TypeExtensions/KVC Extensions/NSObject_KVCArrayForwarding.m index 2feb144..c99a0f9 100644 --- a/TypeExtensions/KVC Extensions/NSObject_KVCArrayForwarding.m +++ b/TypeExtensions/KVC Extensions/NSObject_KVCArrayForwarding.m @@ -25,8 +25,8 @@ @implementation NSObject_KVCArrayForwarding { - (id)initWithTarget:(id)theTarget keyPath:(NSString *)theKeyPath isMutable:(BOOL)isMutable { if (self = [super init]) { - target = [theTarget retain]; - keyPath = [theKeyPath retain]; + target = theTarget; + keyPath = theKeyPath; NSString * KeyPath = keyPath.capitalizedString; Class class = [self class]; @@ -41,10 +41,10 @@ - (id)initWithTarget:(id)theTarget keyPath:(NSString *)theKeyPath isMutable:(BOO if (subclass == nil) return nil; - class_addMethod(subclass, - @selector(dealloc), - [class instanceMethodForSelector:@selector(dealloc)], - "v@:"); +// class_addMethod(subclass, +// @selector(dealloc), +// [class instanceMethodForSelector:@selector(dealloc)], +// "v@:"); class_addMethod(subclass, NSSelectorFromString([NSString stringWithFormat:@"countOf%@", KeyPath]), @@ -105,13 +105,6 @@ - (id)initWithTarget:(id)theTarget keyPath:(NSString *)theKeyPath isMutable:(BOO return self; } -- (void)dealloc -{ - [target release]; - [keyPath release]; - - [super dealloc]; -} - (NSArray *)arrayProperty { @@ -144,7 +137,7 @@ - (NSArray *)arrayObjectsAtIndexes:(NSIndexSet *)indexes return [self.arrayProperty objectsAtIndexes:indexes]; } -- (void)getArrayObjects:(id *)buffer range:(NSRange)inRange +- (void)getArrayObjects:(__unsafe_unretained id *)buffer range:(NSRange)inRange { [self.arrayProperty getObjects:buffer range:inRange]; } diff --git a/TypeExtensions/KVC Extensions/NSObject_KVCUndefined.m b/TypeExtensions/KVC Extensions/NSObject_KVCUndefined.m index e1a0f7a..c21f47a 100644 --- a/TypeExtensions/KVC Extensions/NSObject_KVCUndefined.m +++ b/TypeExtensions/KVC Extensions/NSObject_KVCUndefined.m @@ -29,10 +29,6 @@ - (void)dealloc [_internal_set unlock]; [_internal_get unlock]; - [undefined release]; - [_internal_set release]; - [_internal_get release]; - [super dealloc]; } - (NSArray *)redefinedKeys diff --git a/TypeExtensions/Other Extensions/Misc.h b/TypeExtensions/Other Extensions/Misc.h index 12d7839..8f5393d 100644 --- a/TypeExtensions/Other Extensions/Misc.h +++ b/TypeExtensions/Other Extensions/Misc.h @@ -8,4 +8,5 @@ #import "NSObject+associatedObject.h" #import "NSObject+invocationForSelector.h" -#import "NSObject+invokeSafely.h" \ No newline at end of file +#import "NSObject+invokeSafely.h" +#import "NSObject_Singleton.h" \ No newline at end of file diff --git a/TypeExtensions/Other Extensions/TXWeakProxy.h b/TypeExtensions/Other Extensions/TXWeakProxy.h new file mode 100644 index 0000000..441fab4 --- /dev/null +++ b/TypeExtensions/Other Extensions/TXWeakProxy.h @@ -0,0 +1,19 @@ +// +// TXZeroingWeakProxy.h +// TypeExtensions +// +// Created by Ethan Reesor on 1/21/14. +// Copyright (c) 2014 Lens Flare. All rights reserved. +// + +#import + +@interface TXWeakProxy : NSProxy + ++ (instancetype)proxyWithTarget:(NSObject *)target; +- (id)initWithTarget:(NSObject *)target; + +@property (readonly, weak) NSObject * target; +@property (unsafe_unretained, readonly) Class targetClass; + +@end diff --git a/TypeExtensions/Other Extensions/TXWeakProxy.m b/TypeExtensions/Other Extensions/TXWeakProxy.m new file mode 100644 index 0000000..0c64794 --- /dev/null +++ b/TypeExtensions/Other Extensions/TXWeakProxy.m @@ -0,0 +1,39 @@ +// +// TXZeroingWeakProxy.m +// TypeExtensions +// +// Created by Ethan Reesor on 1/21/14. +// Copyright (c) 2014 Lens Flare. All rights reserved. +// + +#import "TXWeakProxy.h" + +@implementation TXWeakProxy + ++ (instancetype)proxyWithTarget:(NSObject *)target +{ + return [[self alloc] initWithTarget:target]; +} + +- (id)initWithTarget:(NSObject *)target +{ +// if (!(self = [super init])) +// return nil; + + _target = target; + _targetClass = target.class; + + return self; +} + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel +{ + return [self.targetClass methodSignatureForSelector:sel]; +} + +- (void)forwardInvocation:(NSInvocation *)invocation +{ + [invocation invokeWithTarget:self.target]; +} + +@end diff --git a/TypeExtensions/Protocol Extensions/NSObject_ProtocolConformer.h b/TypeExtensions/Protocol Extensions/NSObject_ProtocolConformer.h index a29b863..f4e0db2 100644 --- a/TypeExtensions/Protocol Extensions/NSObject_ProtocolConformer.h +++ b/TypeExtensions/Protocol Extensions/NSObject_ProtocolConformer.h @@ -10,7 +10,7 @@ @interface NSObject_ProtocolConformer : NSObject -@property (readonly) Protocol * protocol; +@property (unsafe_unretained, readonly) Protocol * protocol; - (id)initWithProtocol:(Protocol *)protocol; diff --git a/TypeExtensions/TypeExtensions-Info.plist b/TypeExtensions/TypeExtensions-Info.plist index c527d3f..7140ed1 100644 --- a/TypeExtensions/TypeExtensions-Info.plist +++ b/TypeExtensions/TypeExtensions-Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0 + 2.1 CFBundleSignature ???? CFBundleVersion - 100 + 124 NSHumanReadableCopyright Copyright © 2012 Lens Flare. Some rights reserved, see license. NSPrincipalClass diff --git a/TypeExtensions/Value Extensions/NSData+stringValue.m b/TypeExtensions/Value Extensions/NSData+stringValue.m index 8a59a52..a9c2c5e 100644 --- a/TypeExtensions/Value Extensions/NSData+stringValue.m +++ b/TypeExtensions/Value Extensions/NSData+stringValue.m @@ -12,7 +12,7 @@ @implementation NSData (stringValue) - (NSString *)stringValue { - return [[[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding] autorelease]; + return [[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding]; } @end diff --git a/TypeExtensionsTests/TECollectionTests.m b/TypeExtensionsTests/TECollectionTests.m index a06e97d..8b73237 100644 --- a/TypeExtensionsTests/TECollectionTests.m +++ b/TypeExtensionsTests/TECollectionTests.m @@ -8,8 +8,6 @@ #import #import -#import -#import #import "Dummy.h" @@ -19,64 +17,64 @@ @interface TECollectionTests : XCTestCase @implementation TECollectionTests -- (void)testEntrySet -{ - NSDictionary * dictionary = @{ @(1) : @"One", @(2) : @"Two" }; - - NSSet * entries = [dictionary entrySet]; - - NSMutableSet * test = [NSMutableSet setWithCapacity:dictionary.count]; - [test addObject:[NSDictionaryEntrySetEntry dictionaryEntryWithKey:@(1) forDictionary:dictionary]]; - [test addObject:[NSDictionaryEntrySetEntry dictionaryEntryWithKey:@(2) forDictionary:dictionary]]; - - // BUG: for some reason [entries isEqual:test] doesn't work... - for (id obj in test) - if (![entries.allObjects containsObject:obj]) - XCTFail(@"Sets are not equal"); - - for (NSDictionaryEntrySetEntry * entry in entries) { - if ([@(1) isEqual:entry.key]) { - if (![dictionary[@(1)] isEqual:entry.object]) - XCTFail(@"Entry set is bad"); - } else if ([@(2) isEqual:entry.key]) { - if (![dictionary[@(2)] isEqual:entry.object]) - XCTFail(@"Entry set is bad"); - } - } -} - -- (void)testNonRetainingZeroingArray -{ - NSObject * obj = [[Dummy alloc] init]; - - TXMutableWeakArray * arr = [TXMutableWeakArray array]; - - [arr addObject:obj]; - - if (!arr.count) - XCTFail(@"Array does not contain object"); - - [obj release]; - - if (arr.count) - XCTFail(@"Array contains object after it's release"); -} - -- (void)testNonRetainingZeroingDictionary -{ - NSObject * obj = [[Dummy alloc] init]; - - TXMutableWeakDictionary * dict = [TXMutableWeakDictionary dictionary]; - - dict[@(1)] = obj; - - if (!dict.count) - XCTFail(@"Array does not contain object"); - - [obj release]; - - if (dict.count) - XCTFail(@"Array contains object after it's release"); -} +//- (void)testEntrySet +//{ +// NSDictionary * dictionary = @{ @(1) : @"One", @(2) : @"Two" }; +// +// NSSet * entries = [dictionary entrySet]; +// +// NSMutableSet * test = [NSMutableSet setWithCapacity:dictionary.count]; +// [test addObject:[NSDictionaryEntrySetEntry dictionaryEntryWithKey:@(1) forDictionary:dictionary]]; +// [test addObject:[NSDictionaryEntrySetEntry dictionaryEntryWithKey:@(2) forDictionary:dictionary]]; +// +// // BUG: for some reason [entries isEqual:test] doesn't work... +// for (id obj in test) +// if (![entries.allObjects containsObject:obj]) +// XCTFail(@"Sets are not equal"); +// +// for (NSDictionaryEntrySetEntry * entry in entries) { +// if ([@(1) isEqual:entry.key]) { +// if (![dictionary[@(1)] isEqual:entry.object]) +// XCTFail(@"Entry set is bad"); +// } else if ([@(2) isEqual:entry.key]) { +// if (![dictionary[@(2)] isEqual:entry.object]) +// XCTFail(@"Entry set is bad"); +// } +// } +//} +// +//- (void)testNonRetainingZeroingArray +//{ +// NSObject * obj = [[Dummy alloc] init]; +// +// TXMutableWeakArray * arr = [TXMutableWeakArray array]; +// +// [arr addObject:obj]; +// +// if (!arr.count) +// XCTFail(@"Array does not contain object"); +// +// [obj release]; +// +// if (arr.count) +// XCTFail(@"Array contains object after it's release"); +//} +// +//- (void)testNonRetainingZeroingDictionary +//{ +// NSObject * obj = [[Dummy alloc] init]; +// +// TXMutableWeakDictionary * dict = [TXMutableWeakDictionary dictionary]; +// +// dict[@(1)] = obj; +// +// if (!dict.count) +// XCTFail(@"Array does not contain object"); +// +// [obj release]; +// +// if (dict.count) +// XCTFail(@"Array contains object after it's release"); +//} @end diff --git a/TypeExtensionsTests/TEMiscTests.m b/TypeExtensionsTests/TEMiscTests.m index 5b6a978..ff9ca0e 100644 --- a/TypeExtensionsTests/TEMiscTests.m +++ b/TypeExtensionsTests/TEMiscTests.m @@ -12,13 +12,12 @@ #import "Dummy.h" -@interface TEMiscTests : XCTestCase +@interface TEMiscTests : XCTestCase @end @implementation TEMiscTests { NSAutoreleasePool * _pool; - BOOL _caughtDeallocNotification, _caughtKVONotification; } - (void)setUp @@ -26,9 +25,6 @@ - (void)setUp [super setUp]; _pool = [[NSAutoreleasePool alloc] init]; - - _caughtDeallocNotification = NO; - _caughtKVONotification = NO; } - (void)tearDown @@ -38,107 +34,14 @@ - (void)tearDown [super tearDown]; } -- (void)testDeallocateNotifier -{ - id obj; - @autoreleasepool { - obj = [Dummy dummy]; - [obj addDeallocListener:self]; - } - - if (!_caughtDeallocNotification) - XCTFail(@"Did not receive deallocation notification"); -} - -- (void)objectDidDeallocate:(id)obj -{ - _caughtDeallocNotification = YES; -} - -- (void)testKVOBugs -{ - id obj = [Dummy dummy]; - - [obj setValue:@"Hi" forKey:@"something"]; - - if (![@"Hi" isEqualToString:[obj valueForKey:@"something"]]) - XCTFail(@"KVC failed"); - - [obj addObserver:self forKeyPath:@"something" options:0 context:nil]; - - [obj addDeallocListener:self]; - - [obj setValue:@"Lo" forKey:@"something"]; - - if (![@"Lo" isEqualToString:[obj valueForKey:@"something"]]) - XCTFail(@"KVC failed"); - - @try { - [obj removeObserver:self forKeyPath:@"something" context:nil]; - } - @catch (NSException *exception) { - XCTFail(@"Failed: %@", exception); - } - - if (!_caughtKVONotification) - XCTFail(@"KVO notification not caught"); -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +- (void)testSingleton { - _caughtKVONotification = YES; -} - -- (void)testObjectForKey -{ - id obj = [Dummy dummy]; - char * key = "com.firelizzard.TypeExtensions.Test.Misc.associatedObject.ObjectForKey"; - NSString * test = [NSMutableString stringWithString:@"Here is my test object"]; - - // make sure DN doesn't interfere - [obj addDeallocListener:self]; - - [obj setAssociatedObject:test forKey:key]; - if (test != [obj associatedObjectForKey:key]) - XCTFail(@"Did not retreive correct object"); - [obj setAssociatedObject:nil forKey:key]; - if ([obj associatedObjectForKey:key]) - XCTFail(@"Object should be nil"); - - [obj setAssociatedObject:test forSelector:_cmd]; - if (test != [obj associatedObjectForSelector:_cmd]) - XCTFail(@"Did not retreive correct object"); - [obj setAssociatedObject:nil forSelector:_cmd]; - if ([obj associatedObjectForSelector:_cmd]) - XCTFail(@"Object should be nil"); - - [obj setAssociatedObject:test forClass:[self class]]; - if (test != [obj associatedObjectForClass:[self class]]) - XCTFail(@"Did not retreive correct object"); - [obj setAssociatedObject:nil forClass:[self class]]; - if ([obj associatedObjectForClass:[self class]]) - XCTFail(@"Object should be nil"); -} - -- (void)testBadTypes -{ - @try { - [[[[NSObject alloc] init] autorelease] addDeallocListener:self]; - XCTFail(@"Adding a DeallocListener to an NSObject should fail"); - } - @catch (NSException *exception) { } - - @try { - [@"asdf" addDeallocListener:self]; - XCTFail(@"Adding a DeallocListener to an NSObject should fail"); - } - @catch (NSException *exception) { } + id s1 = [NSObject_Singleton sharedInstance]; + id s2 = [s1 copyWithZone:[self zone]]; + id s3 = [[NSObject_Singleton allocWithZone:[self zone]] init]; - @try { - [@(1) addDeallocListener:self]; - XCTFail(@"Adding a DeallocListener to an NSObject should fail"); - } - @catch (NSException *exception) { } + if (s1 != s2 || s2 != s3) + XCTFail(@"Sington pattern broken"); } @end \ No newline at end of file