Remove 32bit runtime compatibility classes.
This commit is contained in:
1 parent
3dbfa1e9a7
commit
66d9fe43b6
8 files changed
-157
No files matched your search
@@ -1,9 +0,0 @@
|
|||||||
//
|
|
||||||
// NSArray+Subscripting.h
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface NSArray (Subscripting)
|
|
||||||
@end
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
//
|
|
||||||
// NSArray+Subscripting.m
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "NSArray+Subscripting.h"
|
|
||||||
#import <objc/runtime.h>
|
|
||||||
|
|
||||||
@implementation NSArray (Subscripting)
|
|
||||||
|
|
||||||
+ (void)load
|
|
||||||
{
|
|
||||||
Class class = [self class];
|
|
||||||
SEL swizzledSelector = @selector(dg_objectAtIndexedSubscript:);
|
|
||||||
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
|
|
||||||
|
|
||||||
class_addMethod([NSArray class],
|
|
||||||
@selector(objectAtIndexedSubscript:),
|
|
||||||
method_getImplementation(swizzledMethod),
|
|
||||||
method_getTypeEncoding(swizzledMethod)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)dg_objectAtIndexedSubscript:(NSInteger)index {
|
|
||||||
return self[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
//
|
|
||||||
// NSDictionary+Subscript.h
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface NSDictionary (Subscript)
|
|
||||||
@end
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
//
|
|
||||||
// NSDictionary+Subscript.m
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "NSDictionary+Subscript.h"
|
|
||||||
#import <objc/runtime.h>
|
|
||||||
|
|
||||||
@implementation NSDictionary (Subscript)
|
|
||||||
|
|
||||||
+ (void)load {
|
|
||||||
Class class = [self class];
|
|
||||||
SEL swizzledSelector = @selector(dg_objectForKeyedSubscript:);
|
|
||||||
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
|
|
||||||
|
|
||||||
class_addMethod([NSDictionary class],
|
|
||||||
@selector(objectForKeyedSubscript:),
|
|
||||||
method_getImplementation(swizzledMethod),
|
|
||||||
method_getTypeEncoding(swizzledMethod)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
-(id)dg_objectForKeyedSubscript:(id)key {
|
|
||||||
return self[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
//
|
|
||||||
// NSMutableArray+Subscript.h
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface NSMutableArray (Subscript)
|
|
||||||
@end
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
//
|
|
||||||
// NSMutableArray+Subscript.m
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "NSMutableArray+Subscript.h"
|
|
||||||
#import <objc/runtime.h>
|
|
||||||
|
|
||||||
@implementation NSMutableArray (Subscript)
|
|
||||||
|
|
||||||
+ (void)load
|
|
||||||
{
|
|
||||||
Class class = [self class];
|
|
||||||
SEL swizzledSelector = @selector(dg_setObject:atIndexedSubscript:);
|
|
||||||
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
|
|
||||||
|
|
||||||
class_addMethod([NSMutableArray class],
|
|
||||||
@selector(setObject:atIndexedSubscript:),
|
|
||||||
method_getImplementation(swizzledMethod),
|
|
||||||
method_getTypeEncoding(swizzledMethod)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)dg_setObject:(id)anObject atIndexedSubscript:(NSUInteger)index {
|
|
||||||
if (anObject == nil) {
|
|
||||||
[NSException raise:NSInvalidArgumentException format:@"setObject:atIndexedSubscript does not allow objects to be nil"];
|
|
||||||
}
|
|
||||||
if (index > self.count) {
|
|
||||||
[NSException raise:NSRangeException format:@"setObject:atIndexedSubscript does not allow the index to be out of array bounds"];
|
|
||||||
}
|
|
||||||
if (index == self.count) {
|
|
||||||
[self addObject:anObject];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
self[index] = anObject;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
//
|
|
||||||
// NSMutableDictionary+Subscript.h
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface NSMutableDictionary (Subscript)
|
|
||||||
@end
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
//
|
|
||||||
// NSMutableDictionary+Subscript.m
|
|
||||||
// Subler
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "NSMutableDictionary+Subscript.h"
|
|
||||||
#import <objc/runtime.h>
|
|
||||||
|
|
||||||
@implementation NSMutableDictionary (Subscript)
|
|
||||||
|
|
||||||
+ (void)load {
|
|
||||||
Class class = [self class];
|
|
||||||
SEL swizzledSelector = @selector(dg_setObject:forKeyedSubscript:);
|
|
||||||
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
|
|
||||||
|
|
||||||
class_addMethod([NSMutableDictionary class],
|
|
||||||
@selector(setObject:forKeyedSubscript:),
|
|
||||||
method_getImplementation(swizzledMethod),
|
|
||||||
method_getTypeEncoding(swizzledMethod)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)dg_setObject:(id)object forKeyedSubscript:(id < NSCopying >)aKey {
|
|
||||||
self[aKey] = object;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
Reference in new issue
Block a user