Convert a C# class (see details) to an iPhone objective C class.
Please stay as close to this C# class as possible, including using Dictionary.
Here is the C# usage of the class. I need an iPhone/Objective C class (NSObject class) which can be used similar to this:
C# usage:
CommDB db = new CommDB();
[login to view URL] ="someCommand";
[login to view URL]("key","value");
[login to view URL]("key2", "value2");
string response = [login to view URL]();
## Deliverables
See the attached file for a better view of the C# class. class CommDB //database communication object { //public properties public string cmd { get; set; } public Dictionary d { get; set; } //this could be added as a variable for play on a different server private const string url = "[login to view URL]"; public CommDB() { d = new Dictionary(); } public string SendPost() { string post = "cmd=" + cmd; //add all name value pairs to post string foreach (KeyValuePair dictionary in d) { post += "&" + [login to view URL] + "=" + [login to view URL]; } string response = null; try { //Our postvars byte[] buffer = [login to view URL](post); //debug //[login to view URL]("POST: {0}", post); //Initialisation, we use localhost, change if appliable HttpWebRequest WebReq = (HttpWebRequest)[login to view URL](url); //Our method is post, otherwise the buffer (postvars) would be useless [login to view URL] = "POST"; //We use form contentType, for the postvars. [login to view URL] = "application/x-www-form-urlencoded"; //The length of the buffer (postvars) is used as contentlength. [login to view URL] = [login to view URL]; //We open a stream for writing the postvars Stream PostData = [login to view URL](); //Now we write, and afterwards, we close. Closing is always important! [login to view URL](buffer, 0, [login to view URL]); [login to view URL](); //Get the response handle, we have no true response yet! HttpWebResponse WebResp = (HttpWebResponse)[login to view URL](); //Let's show some information about the response //[login to view URL]([login to view URL]); //[login to view URL]([login to view URL]); //Now, we read the response (the string), and output it. Stream Answer = [login to view URL](); StreamReader _Answer = new StreamReader(Answer); response = [login to view URL](); } catch (Exception ex) { [login to view URL]([login to view URL]); } return [login to view URL](); } }