facebook/facebook-ios-sdk — Issue #404: Why do methods take NSMutableDictionary instead of NSDictionary?
Author: newacct
Created: 2011-10-19 00:01:43+00:00
State: open

Many methods in the Facebook iOS SDK take an argument named "params" of type `NSMutableDictionary *`:

* `dialog:andParams:andDelegate:`
* `requestWithParams:andDelegate:`
* `requestWithMethodName:andParams:andHttpMethod:andDelegate:`
* `requestWithGraphPath:andParams:andDelegate:`
* `requestWithGraphPath:andParams:andHttpMethod:andDelegate:`
(See https://developers.facebook.com/docs/reference/iossdk/dialog/ and https://developers.facebook.com/docs/reference/iossdk/request/)

Yet nowhere in any of these methods' documentation does it say they need to modify the params and have it be accessible by the caller. An argument type of `NSDictionary *` would be better, because it allows the user to pass an immutable dictionary, in addition to being able to pass mutable dictionaries (since NSMutableDictionary is a subclass of NSDictionary).