Skip to content

Commit

Permalink
Fix iPhone 5c Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
WenchaoD committed Oct 20, 2016
1 parent d8a9cfc commit b7a877a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions FSCalendar/FSCalendarExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
if (!invocation) return nil;
invocation.target = self;
invocation.selector = selector;

// Parameters
if (firstObject) {
int index = 2;
Expand All @@ -169,7 +168,7 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
#define PARAM_STRUCT_TYPES(_type,_getter,_default) \
if (!strcmp(argType, @encode(_type))) { \
_type value = [obj respondsToSelector:@selector(_getter)]?[obj _getter]:_default; \
[invocation setArgument:&value atIndex:index++]; \
[invocation setArgument:&value atIndex:index]; \
}
PARAM_STRUCT_TYPES(CGPoint, CGPointValue, CGPointZero)
PARAM_STRUCT_TYPES(CGSize, CGSizeValue, CGSizeZero)
Expand All @@ -182,12 +181,13 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
PARAM_STRUCT_TYPES(NSRange, rangeValue, NSMakeRange(NSNotFound, 0))

#undef PARAM_STRUCT_TYPES
index++;
} else {
// basic type
#define PARAM_BASIC_TYPES(_type,_getter) \
if (!strcmp(argType, @encode(_type))) { \
_type value = [obj respondsToSelector:@selector(_getter)]?[obj _getter]:0; \
[invocation setArgument:&value atIndex:index++]; \
[invocation setArgument:&value atIndex:index]; \
}
PARAM_BASIC_TYPES(BOOL, boolValue)
PARAM_BASIC_TYPES(int, intValue)
Expand All @@ -202,6 +202,7 @@ - (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ...
PARAM_BASIC_TYPES(double, doubleValue)

#undef PARAM_BASIC_TYPES
index++;
}
}
} while((obj = va_arg(args, id)));
Expand Down

0 comments on commit b7a877a

Please sign in to comment.