[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
parent 17262db5a9
commit 09460cf21b
2 changed files with 4 additions and 6 deletions

View File

@ -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)

View File

@ -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];