WebView Failed error in iPhone - iphone

I am trying to load website in webview.But i am getting error. Please correct me where i am wrong
URL : http://www.facebook.com/pages/Fresh-Caesar/144860502248864
Error : The operation couldn’t be completed. (WebKitErrorDomain error 101.)

We can resolve this problem by using string encoding
NSString *encodedString=[siteUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *weburl = [NSURL URLWithString:encodedString];

Maybe look at WebKitErrorDomain error 101 for reference. Need to see more of your code though. Can you provide listing?

Related

CX innovatory storage integration in iphone

I'm developing an iPhone app where I'm integrating CX cloud storage so that I can store images and audio files. I"m trying to load login page on UIWebView but its giving me error.
here is my code
NSURL *loginUrl=[NSURL URLWithString:[NSString stringWithFormat:#"
https://www.cx.com/mycx/oauth/authorize?client_id=%#&redirect_uri=%#",clientID,redirectURi]];
NSURLRequest *requestObj=[NSURLRequest requestWithURL:loginUrl];
[webview loadRequest:requestObj];
I'm getting following error
Error Domain=WebKitErrorDomain Code=101 "The operation couldn’t be completed. (WebKitErrorDomain error 101.)" UserInfo=0x68102e0 {}
The CX innovatory has been discontinued.
Sorry for the inconvenience!

app crashing while I try to tweet

I am using SA_OAuthTwitterController api for integrating twitter. While I try to post the tweet using
[_engine sendUpdate:tweetTextField.text]
my app crashes. I am getting the error:
Authenicated for (null).
Also My stack after crash shows me:OAMutableURL Request URL encoded string. what the problem ?
From the limited amount of information given it seems that no user has been authenticated. You may authenticate the user with a different instance of _engine which would be causing a crash.
and also may your URL not encoded with string here bellow some characters encode code define in bellow link after use this code in your URL if special characters are use...
http://www.w3schools.com/tags/ref_urlencode.asp
and also for encode the NSURL just use bellow code...
NSString* escapedUrlString =
[unescapedString stringByAddingPercentEscapesUsingEncoding:
NSASCIIStringEncoding];
hope,this help you...
:)

iphone sdk how to parse a https url?

I am using an url in HTTPS mode. Now I need to parse this url link using NSXMLParser. I tried to parse it but am getting this error "Unable to download story feed from web site(Error code 5)". Is it possible to parse a https url? Why am getting this error? Is there any sample code or links? Kindly help me to get out of this. Thanks in advance.
Not sure to understand, but if you've got an URL as a string, you can create a NSURL object with the urlWithString: method.
NSURL * url = [ NSURL urlWithString: #"https://www.example.org/foo/bar.html" ];
Then, you'll have access to all URL parts, using the NSURL methods, like host, path, scheme, port, and so on...

SA_OAuthTwitterEngine Twitter authentication on iOS 5 (error -1012)

I'm using SA_OAuthTwitterEngine and it works fine for some accounts. But, gives (NSURLErrorDomain error -1012.) for some twitter accounts.
It seems to work fine on ios 4. But not on iOS 5. anyone notices this problem?
Any hints?
Thanks
Yes... Change http to https in the initOAuthWithDelegate method inside SA_OauthTwitterEngine.m and this should fix the problem - like so:
self.requestTokenURL = [NSURL URLWithString: #"https://twitter.com/oauth/request_token"];
self.accessTokenURL = [NSURL URLWithString: #"https://twitter.com/oauth/access_token"];
self.authorizeURL = [NSURL URLWithString: #"https://twitter.com/oauth/authorize"];
try find&replace http://twitter.com/oauth/ with https://twitter.com/oauth/
3x
#NSDestroyer is correct. Just ran into this today, and changing to https solved the issues. Thanks!

Send message via mobile phone to web server

I try to send title and message to web server. I want to receive response if the request is successful or failure. But I don't from where to start. Can someone help me?
Best regards
It's much prefered to use a ASIHTTPRequest for proper error handling, but a quick and dirty solution could be:
NSString *response = [NSString stringWithContentsOfURL:[NSURL URLWithString:#"http://xxx.yyy"] encoding:NSUTF8StringEncoding error:nil];
BOOL success = response!=nil && ([response rangeOfString:#"success"].location != NSNotFound);
An good library is ASIHTTPRequest.
You can look at apples URL Loading System Programming Guide
Use ASIHTTPRequest it is a wrapper for CFNetowork that lets you easily do what you want.