[ReactNative] Use explicit doubles on RCTLocationOptions to avoid NSInvocation bug
This commit is contained in:
Родитель
17262db5a9
Коммит
09460cf21b
|
@ -28,9 +28,9 @@ typedef NS_ENUM(NSInteger, RCTPositionErrorCode) {
|
||||||
#define RCT_DEFAULT_LOCATION_ACCURACY kCLLocationAccuracyHundredMeters
|
#define RCT_DEFAULT_LOCATION_ACCURACY kCLLocationAccuracyHundredMeters
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NSTimeInterval timeout;
|
double timeout;
|
||||||
NSTimeInterval maximumAge;
|
double maximumAge;
|
||||||
CLLocationAccuracy accuracy;
|
double accuracy;
|
||||||
} RCTLocationOptions;
|
} RCTLocationOptions;
|
||||||
|
|
||||||
@implementation RCTConvert (RCTLocationOptions)
|
@implementation RCTConvert (RCTLocationOptions)
|
||||||
|
|
|
@ -381,10 +381,8 @@ static NSString *RCTStringUpToFirstArgument(NSString *methodName)
|
||||||
|
|
||||||
case '{': {
|
case '{': {
|
||||||
[argumentBlocks addObject:^(RCTBridge *bridge, NSNumber *context, NSInvocation *invocation, NSUInteger index, id json) {
|
[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];
|
NSMethodSignature *methodSignature = [RCTConvert methodSignatureForSelector:selector];
|
||||||
|
void *returnValue = malloc(methodSignature.methodReturnLength);
|
||||||
NSInvocation *_invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
|
NSInvocation *_invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
|
||||||
[_invocation setTarget:[RCTConvert class]];
|
[_invocation setTarget:[RCTConvert class]];
|
||||||
[_invocation setSelector:selector];
|
[_invocation setSelector:selector];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче