Find Jobs
Hire Freelancers

Convert C# class to iPhone Objective C class

$5-10 USD

In Progress
Posted over 12 years ago

$5-10 USD

Paid on delivery
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](); } }
Project ID: 3722322

About the project

2 proposals
Remote project
Active 12 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$7 USD in 2 days
5.0 (14 reviews)
4.1
4.1
2 freelancers are bidding on average $7 USD for this job
User Avatar
See private message.
$7 USD in 2 days
4.9 (23 reviews)
4.6
4.6

About the client

Flag of UNITED STATES
United States
5.0
48
Member since Mar 15, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.