FMSSwizzler
 All Classes Files Functions Typedefs Enumerations Enumerator
Classes | Typedefs | Enumerations
NSObject+FMSSwizzler.h File Reference
#import <Foundation/Foundation.h>

Go to the source code of this file.

Classes

category  NSObject(FMS_Swizzler)
 FMSSwizzler's public methods. More...

Typedefs

typedef enum pseudoPropertyType FMSPseudoPropertyType
typedef void(^ FMSPseudoPropertyAdder )(NSString *propertyName)

Enumerations

enum  pseudoPropertyType {
  FMSObjectRetain, FMSObjectCopy, FMSObjectAssignUnsafe, FMSBool,
  FMSInteger, FMSUnsignedInteger, FMSFloat, FMSDouble
}

Detailed Description

The public interface for FMSSwizzler.

Note: I've tried to test and identify most of the obvious gotchas. However, by it's nature class and method swizzling is inherently unsafe. There may be additional edge cases that will cause errors. Please use these methods with care, and test your code thoroughly.

Note: to add the library to a project, first add the library to the target project, then set the project's Other Linker Flags build setting to -ObjC. This will force the compiler to include the NSObject+FMSSwizzler code.

You can either copy NSObject+FMSSwizzler.h and the appropriate libFMSSwizzler_*.a file into the target project, or you can place both projects in a workspace. If the destination project and library share a workspace, make sure to add the following paths to the destination project's build settings.

For iOS: User Header Search Paths: "$OBJROOT/UninstalledProducts/include/"

For OSX: Header Search Paths: "$TARGET_BUILD_DIR/usr/local/include"

Then import the header as "FMSSwizzler/NSObject+FMSSwizzler.h"

Typedef Documentation

typedef void(^ FMSPseudoPropertyAdder)(NSString *propertyName)

A block that can add a property of the given property name to its class. You should generate an FMSPseudoPropertyAdder block for each class, and for each property type.

Used to identify the property type for dynamically added pseudo-properties

Enumeration Type Documentation

Used to set the property type for dynamicly added pseudo-properties. All properties are nonatomic.

Enumerator:
FMSObjectRetain 

Used for objects that should be retained.

FMSObjectCopy 

Used for objects that should be copied.

FMSObjectAssignUnsafe 

Used for objects that should be assigned unsafely (NOT a zeroing weak reference).

FMSBool 

Used for scalar BOOL values

FMSInteger 

Used for scalar NSInteger values

FMSUnsignedInteger 

Used for scalar NSUInteger values

FMSFloat 

Used for scalar float values

FMSDouble 

Used for scalar double values