[ReactNative] Use explicit doubles on RCTLocationOptions to avoid NSInvocation bug

This commit is contained in:
Tadeu Zagallo 2015-05-02 14:11:09 -07:00
Родитель 17262db5a9
Коммит 09460cf21b
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -28,9 +28,9 @@ typedef NS_ENUM(NSInteger, RCTPositionErrorCode) {
#define RCT_DEFAULT_LOCATION_ACCURACY kCLLocationAccuracyHundredMeters
typedef struct {
NSTimeInterval timeout;
NSTimeInterval maximumAge;
CLLocationAccuracy accuracy;
double timeout;
double maximumAge;
double accuracy;
} RCTLocationOptions;
@implementation RCTConvert (RCTLocationOptions)

Просмотреть файл

@ -381,10 +381,8 @@ static NSString *RCTStringUpToFirstArgument(NSString *methodName)
case '{': {
[argumentBlocks addObject:^(RCTBridge *bridge, NSNumber *context, NSInvocation *invocation, NSUInteger index, id json) {
NSUInteger size;
NSGetSizeAndAlignment(argumentType, &size, NULL);
void *returnValue = malloc(size);
NSMethodSignature *methodSignature = [RCTConvert methodSignatureForSelector:selector];
void *returnValue = malloc(methodSignature.methodReturnLength);
NSInvocation *_invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
[_invocation setTarget:[RCTConvert class]];
[_invocation setSelector:selector];