Hi Guys!
I am developing Twitter API to my application. In my app, I want to display the tiny url with parsed xml link in UITexField as dynamically. statically, I could able to display tiny url in UITextField, but dynamically I am not able to display the tiny url. Please help me!
Code: statically(Working fine),
NSURL *url = [NSURL URLWithString"http://tinyurl.com/api-create.php?
url=https://gifts.development.xxxxx.edu/xxxx/Welcome.aspx?appealcode=23430"];
NSString *link = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:nil];
Dynamically,
NSString * tiny = [NSString stringWithFormat:@"http://tinyurl.com/api-create.php? url=%@", shtUrl];//shtUrl is parsed string
NSURL *url = [NSURL URLWithString:tiny];
NSString *link = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:nil];
In above, dynamically app running without warning and error, but url not displayed and when I am checking debugger, url and link both are show nil value. But shtUrl show whole url value as properly.
I tried with all NSURL class and instance methods and String methods also.