Closed nuthankumarns closed 11 years ago
I can confirm this issue and am also experiencing it.
With 2.4.0, NSJSONSerialization is used, thus objects returned are immutable: http://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html
Any NSDictionaries from the arguments should be considered immutable: https://github.com/phonegap/phonegap-facebook-plugin/blob/4993bdfed213593401c64d8233ebfdea37c484f8/native/ios/FacebookConnectPlugin.m#L284
I will submit a patch soon.
there is a plugin for Facebook that still shows the same issue. it is https://github.com/mgcrea/cordova-facebook-connect.
I think the problem its with these lines:
(void)requestWithGraphPath:(NSMutableArray )arguments withDict:(NSMutableDictionary )options { DLog(@"requestWithGraphPath:%@\n withDict:%@", arguments, options);
// The first argument in the arguments parameter is the callbackId. [self.callbackIds setValue:[arguments pop] forKey:@"requestWithGraphPath"]; NSString path = [options objectForKey:@"path"] ?: @"me"; NSMutableDictionary params = [[options objectForKey:@"options"] mutableCopy] ?: [[NSMutableDictionary alloc] init]; NSString *httpMethod = [options objectForKey:@"httpMethod"] ?: @"GET";
// Make sure we pass a string for a limit key if([params valueForKey:@"limit"]) [params setValue:[NSString stringWithFormat:@"%d", [[params valueForKey:@"limit"] integerValue]] forKey:@"limit"];
FBRequest *request = [self.facebook requestWithGraphPath:path andParams:params andHttpMethod:httpMethod andDelegate:self];
[self.facebookRequests setValue:request forKey:[self.callbackIds valueForKey:@"requestWithGraphPath"]];
}
Thanks @allanridolfi please file an issue at https://github.com/mgcrea/cordova-facebook-connect/issues so it will get noticed by the author.
Thanks for your reply @shazron, the author should be in vacation :) this issue was already posted right there weeks ago. With your experience, could you plz try to help us? Me and the community will appreciate that much, as we already appreciate phonegap!
Facebook wall post, calling FB.ui(params, function(obj) { console.log(obj);}); terminates
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary removeObjectForKey:]: mutating method sent to immutable object'