Basic HTTP Authentication using Obj C and Xcode.

Posted by Kristiaan on Stack Overflow See other posts from Stack Overflow or by Kristiaan
Published on 2010-03-18T13:43:04Z Indexed on 2010/03/18 13:51 UTC
Read the original article Hit count: 553

Filed under:
|
|

Hi Everyone,

I am hoping someone can help me with a question i have relating to Basic HTTP Authentication in an Xcode 2.3 application.

Basically i have a PHP page that is on our server and when called with certain parameters returns data relating to the servers condition etc.

i have managed to get a small Xcode application working where by it reads the data from the page and populates an NSTextView with the data.

however to make sure this information stays safe i have setup basic HTTP Authentication on the page, but i cannot work out how to provide the username and password in XCode.

here is my code to retrieve the page.

NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
NSString *content = [NSString stringWIthContentsOfUrl:url];
[myTextView setString:content];

i am still at a very basic beginner level regarding xcode and obj c, so nice simple examples of how i go about this would really be appreciated.

Thanks Kris

© Stack Overflow or respective owner

Related posts about xcode

Related posts about http