diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac8f968 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Logs and databases # +###################### +*.log + +# OS generated files # +###################### +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db diff --git a/README b/README index 7fd106c..b7b9dd0 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ SwizzleKit is intended to be a collection of macros, functions, categories and c Rationale -Writing plugins for closed sourced applications is difficult and has become more difficult with 10.6 in 64bit mode. +Writing plugins for closed sourced applications is difficult and has become more difficult with 10.6 in 64bit mode. Writing stable and successful plugins require a good degree of methodical work to do trivial task such as writing categories, accessing ivars in methods. SwizzleKit provides a formal way to do this so that theses tasks are bug free. diff --git a/SwizzleKit.h b/SwizzleKit.h index f23d5f3..7c9cb93 100644 --- a/SwizzleKit.h +++ b/SwizzleKit.h @@ -8,9 +8,9 @@ // ------------------------------------------------------------------------ -// Underimplemented!!!! +// Underimplemented!!!! // -// This is a work in progress. somethings probaby won't work. +// This is a work in progress. somethings probaby won't work. // have fun! @@ -45,10 +45,10 @@ #define SUPER(...) objc_msgSendSuper(&(struct objc_super){self, class_getSuperclass([self class])},_cmd, ##__VA_ARGS__) -//respondsDirectlyToSelector method returns YES if this object implements the selector directly. +//respondsDirectlyToSelector method returns YES if this object implements the selector directly. // Returns NO if any superclass implements the selector or no superclass implemention. -@interface NSObject (UNIQUE_PREFIXswizzleKit) +@interface NSObject (UNIQUE_PREFIXswizzleKit) -(BOOL)UNIQUE_PREFIXrespondsDirectlyToSelector:(SEL)aSelector; @end @@ -74,8 +74,8 @@ void UNIQUE_PREFIXdescribeClass(const char * clsName); // It will also create a class Method +mapTable that will create the maptable on the first call (access though the accessors function above. // The mapTableVariables should be accessed ONLY through the use of the functions declared above -// - +// + #define IMPLEMENT_MAPTABLE_VARIABLES_USING_PREFIX(prefix) \ static NSMapTable *_mappedViewerIVars = NULL; \ static NSLock * _mapTableLock = nil; \ @@ -184,8 +184,8 @@ void UNIQUE_PREFIXdescribeClass(const char * clsName); } \ -id UNIQUE_PREFIXobject_getMapTableVariable(id anObject, const char* variableName); -void UNIQUE_PREFIXobject_setMapTableVariable(id anObject, const char* variableName,id value); +id UNIQUE_PREFIXobject_getMapTableVariable(id anObject, const char* variableName); +void UNIQUE_PREFIXobject_setMapTableVariable(id anObject, const char* variableName,id value); diff --git a/SwizzleKit.m b/SwizzleKit.m index 38d2e73..f29187f 100644 --- a/SwizzleKit.m +++ b/SwizzleKit.m @@ -17,7 +17,7 @@ -(BOOL)UNIQUE_PREFIXrespondsDirectlyToSelector:(SEL)aSelector{ BOOL responds = NO; unsigned int methodCount = 0; Method * methods = nil; - + // extend instance Methods methods = class_copyMethodList([self class], &methodCount); int ci= methodCount; @@ -79,7 +79,7 @@ void UNIQUE_PREFIXobject_setMapTableVariable(id anObject, const char* variableNa } } } - + } void UNIQUE_PREFIXdescribeClass(const char * clsName){ @@ -94,26 +94,26 @@ void UNIQUE_PREFIXdescribeClass(const char * clsName){ Ivar * ivars = class_copyIvarList(aClass, &ivarCount); for (ci=0;ci