Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Remove Category Loader #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions JLJSONMapping/Category/FABJLCategoryLoader.h

This file was deleted.

21 changes: 0 additions & 21 deletions JLJSONMapping/Category/FABJLCategoryLoader.m

This file was deleted.

6 changes: 0 additions & 6 deletions JLJSONMapping/Category/NSError+JLJSONMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@

#import <Foundation/Foundation.h>

FOUNDATION_EXPORT NSString * const kFABObjectMappingDomain;
FOUNDATION_EXPORT NSString * const kFABObjectMappingDescriptionKey;
FOUNDATION_EXPORT NSString * const kFABObjectMappingFailureReasonKey;

typedef NS_ENUM(NSInteger, FABJLDeserializationError) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were causing import issues while I had been making changes to the Framework loading in the sample app.

FABJLDeserializationErrorInvalidJSON, //Malformed JSON or other general NSJSONSerialization Error
FABJLDeserializationErrorNoPropertiesInClass, //Couldn't find any properties on Object
FABJLDeserializationErrorPropertyTypeMapNeeded, //Object has Array/Dict as property but missing definition of jl_propertyTypeMap
FABJLDeserializationErrorMorePropertiesExpected //JSON to Object mismatch, JSON has extra fields (not a show stopping error for deserializer)
};

void linkFABErrorCategory();

@interface NSError (FABJLJSONMapping)

+ (NSError *)errorWithReason:(FABJLDeserializationError)reason reasonText:(NSString *)reasonText description:(NSString *)description;
Expand Down
12 changes: 3 additions & 9 deletions JLJSONMapping/Category/NSError+JLJSONMapping.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,18 @@

#import "NSError+JLJSONMapping.h"

NSString * const kFABObjectMappingDomain = @"com.fabric.objectmapping";
NSString * const kFABObjectMappingDescriptionKey = @"FABJLObjectMappingDescriptionKey";
NSString * const kFABObjectMappingFailureReasonKey = @"FABJLObjectMappingDetailedFailureReasonKey";

@implementation NSError (FABJLJSONMapping)

void linkFABErrorCategory(){}

+ (NSError *)errorWithReason:(FABJLDeserializationError)reason reasonText:(NSString *)reasonText description:(NSString *)description
{
NSMutableDictionary *infoDict = [[NSMutableDictionary alloc] init];
if (reasonText) {
[infoDict setObject:reasonText forKey:kFABObjectMappingFailureReasonKey];
[infoDict setObject:reasonText forKey:@"FABJLObjectMappingDetailedFailureReasonKey"];
}
if (description) {
[infoDict setObject:description forKey:kFABObjectMappingDescriptionKey];
[infoDict setObject:description forKey:@"FABJLObjectMappingDescriptionKey"];
}
return [NSError errorWithDomain:kFABObjectMappingDomain code:reason userInfo:([infoDict count] > 0) ? infoDict : nil];
return [NSError errorWithDomain:@"com.fabric.objectmapping" code:reason userInfo:([infoDict count] > 0) ? infoDict : nil];
}

@end
1 change: 0 additions & 1 deletion JLJSONMapping/Category/NSMutableArray+JLJSONMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import <Foundation/Foundation.h>

void linkFABMutableArrayCategory();

@interface NSMutableArray (FABJLJSONMapping)

Expand Down
2 changes: 0 additions & 2 deletions JLJSONMapping/Category/NSMutableArray+JLJSONMapping.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

@implementation NSMutableArray (FABJLJSONMapping)

void linkFABMutableArrayCategory(){}

+ (NSMutableArray *)jl_newSparseArray:(NSUInteger)size
{
NSMutableArray *newArray = [[NSMutableArray alloc] initWithCapacity:size];
Expand Down
2 changes: 0 additions & 2 deletions JLJSONMapping/Category/NSObject+JLJSONMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#import <Foundation/Foundation.h>

void linkFABObjectCategory();

@interface NSObject (FABJLJSONMapping)

/*
Expand Down
2 changes: 0 additions & 2 deletions JLJSONMapping/Category/NSObject+JLJSONMapping.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

@implementation NSObject (FABJLJSONMapping)

void linkFABObjectCategory(){}

+ (NSDateFormatter *)jl_dateFormatterForPropertyNamed:(NSString*)propertyName
{
//NOTE: ignoring propertyName
Expand Down
2 changes: 0 additions & 2 deletions JLJSONMapping/Mapping/FABJLObjectDeserializer.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import <objc/runtime.h>
#import "FABJLCategoryLoader.h"
#import "FABJLObjectDeserializer.h"
#import "FABJLObjectMappingUtils.h"
#import "FABJLTimer.h"
Expand All @@ -31,7 +30,6 @@ - (id)initWithDeserializerOptions:(FABJLDeserializerOptions)options
if (self) {
_optionMask = options;
_collectedPropertyCache = [[NSCache alloc] init];
[FABJLCategoryLoader loadCategories];
}
return self;
}
Expand Down
2 changes: 0 additions & 2 deletions JLJSONMapping/Mapping/FABJLObjectSerializer.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import <objc/runtime.h>
#import "FABJLCategoryLoader.h"
#import "FABJLObjectMapper.h"
#import "FABJLObjectMappingUtils.h"
#import "FABJLObjectSerializer.h"
Expand All @@ -31,7 +30,6 @@ - (id)initWithSerializerOptions:(FABJLSerializerOptions)options
if (self) {
_optionMask = options;
_classPropertiesNameMap = [[NSCache alloc] init];
[FABJLCategoryLoader loadCategories];
}
return self;
}
Expand Down