nsurlconnection

POST from iPhone to PhP not working

旧街凉风 提交于 2019-12-24 11:52:06
问题 First time using POST POST information is not getting from the iPhone to the PhP script. I get no errors anywhere. var_dump($_POST) shows empty. failed login returned. Any ideas where to look next or do I have a visible problem here: NSURL *url = [NSURL URLWithString:link]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; NSString *requestBodyString = [NSString stringWithFormat:@"txtuid=%@&txtpwd=%@", userName , password]; NSData *requestBody = [NSData dataWithBytes:

iPad: ImageIO: <ERROR> JPEGNot a JPEG file: starts with 0xff 0xd9 [closed]

ぐ巨炮叔叔 提交于 2019-12-24 11:07:17
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . the error-message i quoted in question-title is driving me crazy on my iPad. i am downloading some Jpeg-Files form HTTP-Servers, and using my code works

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) error not on all iPhones?

爷,独闯天下 提交于 2019-12-24 10:58:38
问题 one of my apps cannot connect to it's API server. The logged reason is NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) . So far no luck on finding why or what, but the most frustrating thing is, that this problem appears on some of my test devices. On other everything is fine. I am using NSURLConnection:sendSynchronousRequest:returningResponse:error: , but after some refactoring and trying with NSURLSessionDataTask:dataTaskWithRequest:completionHandler: , the

How to pass an BIG5 chinese characters in objective-c

纵然是瞬间 提交于 2019-12-24 09:36:57
问题 I want to pass an Chinese characters (BIG5) in NSURLConnection in my request but it shows an error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0xa17a750 {NSUnderlyingError=0xa17ffa0 "bad URL", NSLocalizedDescription=bad URL} 回答1: You should escape your string by using -[NSString stringByAddingPercentEscapesUsingEncoding:] method before using it in URL. And I suspect you should also convert your big5 string to utf8 before escaping. EDIT: To use BIG5 you can use this: NSStringEncoding

How to simply test a local Wifi Connection to an IP, for example 192.168.0.100 with code status?

霸气de小男生 提交于 2019-12-24 09:21:37
问题 Do you know if I can simply test if there is a WIFI local connection ? For example if the url 192.168.0.100 is reachable. I tried with the Reachability without success. It tells me that it is connected, but it is not true. I would like first to test if there is a local WIFI connection, and then when I am sure there is a connection, launch that Web Service : - (void)callWebService:(NSString *)url withBytes:(NSString *) bytes //GET { NSMutableURLRequest* request = [[NSMutableURLRequest alloc]

NSURLConnection crash on releasing NSMutableData

送分小仙女□ 提交于 2019-12-24 08:58:19
问题 I have followed the instruction from Using NSURLConnection and sometimes (very very seldom) my project crashes in method. - (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [connection release]; [myNSMutableData release]; } It crashes when i try to release my NSMutableData . I want to know why it crashes! Some code I use: - (void) start { while (1) { NSString *stringURL = @"http://www.iwheelbuy.com/get.php?sex=1"; NSURL *url = [NSURL URLWithString:stringURL]

WhatsApp showing alert “This item cannot be shared. Please select a different item.” for iOS app.

天涯浪子 提交于 2019-12-24 01:44:37
问题 I am developing an iOS app. In that app I have on social sharing feature and that Social sharing feature uses deep linking for sharing the url. That url sharing is working fine fine for all the apps except WhatsApp . It shows an alert popup "This item cannot be shared. Please select a different item". Below is the my code please suggest the changes I can make to it can be send on WhatsApp too. func actioncontroller(){ let actionSheetController: UIAlertController = UIAlertController(title: nil

iPhone access local XML file

馋奶兔 提交于 2019-12-24 00:38:35
问题 I have an iPhone app that does XML parsing from a URL. I have a sample.xml file in my Resources directory (in XCode) that I'd like to use. How do I reference this file in code? I've tried @"sample.xml" as the URL and it doesn't appear to be able to find it. 回答1: First off, be careful passing a URL as a path and vice-versa - you may not be able to readily interchange the two. If you must, try prefixing the path of the file with file:// . As for finding the path, you can use the NSBundle method

How to start playing AVAudioPlayer while downloading?

亡梦爱人 提交于 2019-12-23 15:20:00
问题 I have a mp3 track at a URL http://mysite.com/MP3/track1.mp3. Downloading it to a local path with NSURLConnection and NSDocumentDirectory. I would like to start playing this track as soon as possible and not after it is completely downloaded. Is there a while to accomplish this? I have tried setting a "X" size limit, and once the download hits that number to start playing the track. But this only plays up to the point where it was initialized at the "X" size. Thanks in advance. - (void

Ionic IOS app NSURLConnection error 1100

∥☆過路亽.° 提交于 2019-12-23 10:15:36
问题 I am trying to run my ionic app as a ios native app and am getting a strange URL connection error that is preventing the data from being populated on my app's view. When I run the App in the web browser as an iphone it runs and populates fine, but when running it on the native ios it doesn't populate the page as expected using the API data. I have checked the console and the API is in fact being called, but the xcode console is printing out the following for the 2 API calls which populate the