我试过了
NSString *alertTxt =textfieldName.text;
NSLog(@"Name: %@",alertTxt);
NSURL *urlAddress = [[NSURL alloc ] initWithString: @"%@/login/index.php",alertTxt];错误: initstring函数的参数太多。
用户将给alertText字段的网址,我必须嵌入到网络工具包,我可以知道如何使它的过程!
我在哪里犯了错,请在这方面帮助我
谢谢
发布于 2010-07-23 14:22:57
-initWithString:只能接受完整字符串,而不能接受格式字符串。要使用-initWithString:,您需要先完成字符串。
NSString* urlString = [NSString stringWithFormat:@"%@/login/index.php", alertTxt];
NSURL* urlAddress = [[NSURL alloc] initWithString:urlString];顺便说一句,使用-stringByAppendingString:可能更有效。
NSString* urlString = [alertTxt stringByAppendingString:@"/login/index.php"];https://stackoverflow.com/questions/3315744
复制相似问题