[
https://issues.apache.org/jira/browse/CB-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shazron Abdullah updated CB-5001:
---------------------------------
Description:
When I'm going to pass a quite large (about 80kb) content via CDVPluginResult/
messageAsDictionary, my app crashes,
if I use messageAsString the app works without problem
// crashes
{code}
NSMutableDictionary* resultDict = [[[NSMutableDictionary alloc] init]
autorelease];
[resultDict setObject:data forKey:@"data"];
[resultDict setObject:cancelledNumber forKey:@"cancelled"];
CDVPluginResult* result = [CDVPluginResult
resultWithStatus: CDVCommandStatus_OK
messageAsDictionary: resultDict
];
NSString* js = [result toSuccessCallbackString:callback];
[self writeJavascript:js];
{code}
// works
{code}
NSMutableDictionary* resultDict = [[[NSMutableDictionary alloc] init]
autorelease];
[resultDict setObject:data forKey:@"data"];
[resultDict setObject:cancelledNumber forKey:@"cancelled"];
CDVPluginResult* result = [CDVPluginResult
resultWithStatus: CDVCommandStatus_OK
messageAsString:data
];
NSString* js = [result toSuccessCallbackString:callback];
[self writeJavascript:js];
{code}
was:
When I'm going to pass a quite large (about 80kb) content via CDVPluginResult/
messageAsDictionary, my app crashes,
if I use messageAsString the app works without problem
// crashes
NSMutableDictionary* resultDict = [[[NSMutableDictionary alloc] init]
autorelease];
[resultDict setObject:data forKey:@"data"];
[resultDict setObject:cancelledNumber forKey:@"cancelled"];
CDVPluginResult* result = [CDVPluginResult
resultWithStatus: CDVCommandStatus_OK
messageAsDictionary: resultDict
];
NSString* js = [result toSuccessCallbackString:callback];
[self writeJavascript:js];
// works
NSMutableDictionary* resultDict = [[[NSMutableDictionary alloc] init]
autorelease];
[resultDict setObject:data forKey:@"data"];
[resultDict setObject:cancelledNumber forKey:@"cancelled"];
CDVPluginResult* result = [CDVPluginResult
resultWithStatus: CDVCommandStatus_OK
messageAsString:data
];
NSString* js = [result toSuccessCallbackString:callback];
[self writeJavascript:js];
> iOS plugin: Cannot pass quite large (about 80kb) content via CDVPluginResult/
> messageAsDictionary
> -------------------------------------------------------------------------------------------------
>
> Key: CB-5001
> URL: https://issues.apache.org/jira/browse/CB-5001
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 3.1.0
> Environment: IOS / XCode 4.5.1
> Reporter: sgunfio
>
> When I'm going to pass a quite large (about 80kb) content via
> CDVPluginResult/ messageAsDictionary, my app crashes,
> if I use messageAsString the app works without problem
> // crashes
> {code}
> NSMutableDictionary* resultDict = [[[NSMutableDictionary alloc] init]
> autorelease];
> [resultDict setObject:data forKey:@"data"];
> [resultDict setObject:cancelledNumber forKey:@"cancelled"];
>
> CDVPluginResult* result = [CDVPluginResult
> resultWithStatus: CDVCommandStatus_OK
> messageAsDictionary: resultDict
> ];
>
> NSString* js = [result toSuccessCallbackString:callback];
>
> [self writeJavascript:js];
> {code}
> // works
> {code}
> NSMutableDictionary* resultDict = [[[NSMutableDictionary alloc] init]
> autorelease];
> [resultDict setObject:data forKey:@"data"];
> [resultDict setObject:cancelledNumber forKey:@"cancelled"];
>
> CDVPluginResult* result = [CDVPluginResult
> resultWithStatus: CDVCommandStatus_OK
> messageAsString:data
> ];
>
> NSString* js = [result toSuccessCallbackString:callback];
>
> [self writeJavascript:js];
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]