ASIHTTPRequest issues for the iPHone

I have a buddy who is building the web server side of things and he needs my iphone app to send him a request. I don't have any experience in this type of programming so it is proving to be a bit difficult.

I am trying to do a simple request that looks like this:

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL: [NSURL URLWithString:@"http://thewebserverURL"]]; [request setPostValue:[NSString stringWithCString:txtName encoding:NSUTF8StringEncoding] forKey:@"field02"]; [request setPostValue:[NSString stringWithCString:txtTodaysDate encoding:NSUTF8StringEncoding] forKey:@"field05"]; [request startSynchronous]; NSLog(@"%@",[request responseString]);

I am getting 2 errors on each of the "request setPostValue" lines that read "Passing argument 1 of stringWithCString: encoding from incompatible pointer type."

txtName and txtTodaysDate are both NSStrings. What am I doing wrong?

-------------Problems Reply------------

The setPostValue parameter is supposed to be a NSString, so you can just pass txtName and txtTodaysDate directly. stringWithCString is used for converting a NUL-terminated C string to a NSString. Thus, the first parameter is a char *.

Category:iphone Views:0 Time:2010-07-11

Related post

  • I am encountering sync issues on my iPhone 4S. It gives an error message "Cannot get mail the connection to the server failed" 2015-03-05

    Original Title: connection to server failed on iphone 4s This week there were a lot of problems with the outlook mail through Microsoft. Everything through work started working again, but I have been having issues with my iPhone 4S (slow sync time).

  • issues using facebook iphone api to post image and text 2010-06-18

    I have been trying to use the facebook iphone api to publish an image and some text from my app (i.e. using FBRequest call:@"" with the appropriate params. I've found that the behavior is extremely erratic, as it first worked f

  • Several issues considering an iPhone wake-up light app 2011-03-05

    I want to build an iPhone app, it's a simple concept. You know those wake-up lights, that function as an alarm clock but then with a fading light? That's what I want for an app. There are two issues: screen locking and brightness setting. First of al

  • startup screen sometimes showing when resuming - does this indicate a potential memory issue with my iphone app? 2011-05-09

    I have an iPhone application I'm testing - I've just noted when testing it on a device that sometimes when I resume it (i.e. launch it again in the "multitasking" sense when I expect it to appear and continue on) the startup image appears. As if it t

  • ASIHTTPRequest Issue - Cannot POST data to Database 2011-07-06

    I'm trying to build an objective C app which posts data to a remote database using ASIHTTPRequest. Currently, I am using MAMP Server and am struggling to get it to work. The php file works when run online, but I am having trouble getting the iphone a

  • Switching to AFNetworking from ASIHTTPRequest - Issue with ASINetworkQueue 2011-11-08

    I'm working on a problem where I have to download around 10 different large files in a queue, and I need to display a progress bar indicating the status of the total transfer. I have this working just fine with ASIHTTPRequest in iOS4, but I'm trying

  • CSS Search Box Alignment Issue in iPad/iPhone Only 2012-02-21

    I am encountering issues with aligning a CSS Search Input Box like the Google style one found on this tutorial page. I have edited the code to suit my design but for some reason I am unable to get this to align properly within the iPhone/iPad with th

  • Outlook/Exchange 2011 on Mac - issues syncing with iPhone Calendar 2013-03-07

    I am running Outlook 2011 on my work Mac (10.8.2). I set up an Exchange account on my iPhone 4 (iSO 6.0) to sync my calendar, but only certain events sync ... I have narrowed it down to the fact that we use email aliases at work (

  • Why is windows 7 64bit still have issues with recognizing Iphones, ipods, and not installing the drivers to sync correctly!!?? 2014-12-22

    I have done every UPDATE that is available to me automatically, and at all the correct sites, and re-installed everything related to the driver, the itunes, (even using a lower ((older)) version) manually installing the driver, but windows stops all

  • Serious issues Syncing my iPhone with windows 7 2015-01-07

    I am happy to see that I am not alone. When I try to sync my iPhone 3G with iTunes I get an error that says that my device can not be synced. Then I go to restore my iPhone and then it tells me that the device can not be recongnized. I hope that this

  • Animation issue when hiding iPhone toolbar 2010-02-17

    I have a toolbar in my RootViewController and I then hide the toolbar in a SubViewController using the following code: RootViewController - (void)viewDidLoad { ... [self.navigationController setToolbarHidden:FALSE animated:FALSE]; ... } - (void)viewD

  • NSAutoreleasePool issues on the iPhone 2010-07-28

    I have a small iPhone app which has a button on the first view. When I select this button I load up my new view which has an image on it. I'm currently using the following code to load the image from an online source on a separate thread, whilst allo

  • Oritentation issue in landscape (iphone) 2011-01-29

    Good day! I have a view which i forcefully landscape. but the problem which i am facing is that the navigation bar buttons are somewhere else but i have to click few steps (inches) back to let it act. e.g. if button is at frame 0,0 then i have to cli

  • iOS - 'set start-with-shell off' issue when running iPhone application in simulator 2011-04-28

    I am getting the following error when trying to debug my iPhone application in the simulator. Detected an attempt to call a symbol in system libraries that is not present on the iPhone: fcntl$UNIX2003 called from function irc_connect in image KadeCha

  • ASIHTTPRequest Post data from iPhone to PHP 2011-06-29

    In Objective C I want to create a simple application that posts a string to a php file using ASIHTTPRequest. I have no need for an interface and am finding it hard to find any example code. Does anyone know where I can find code, or can anyone give m

  • issues with the iphone app runs on ipad 2011-09-13

    i had a problem with my iphone app runs on ipad .I am using camera overlay view in first screen(launches when app starts) but wehn i navigate to other screen there is ablank white space on top of it.This appears in ipad only , on iphone all works gre

  • Issue in ICalendar Iphone Exporting with ASP 2012-03-21

    Im developing an application in HTML5, I have to enter some data in the Iphone calendar, so I use ASP in my server, and I generate the ics file dynamically. I use something like that: <%@ Language=JavaScript EnableSessionState=False%> <% Res

  • Issues with Pics- iphone to windows gallery 2013-09-13

    When I attempt to edit pictures that I have imported from my iphone using windows photo gallery it will not allow me to save any of my edits. it says "this photo cant be saved because of a problem with the photo's file properties" anybody else experi

  • mail issues laptop to iphone 2015-03-06

    I have windows 8.1 on my laptop I can send and receive emails to through my mail app my problem is I can't receive my emails on my iphone 5s it will not let me set up anyone else having this problem --------------Solutions------------- You didn't rea

Copyright (C), All Rights Reserved.

processed in 0.205 (s). 11 q(s)