发送URL有PrintHello这是我的代码如何从其他文件
在PrintHello.h@interface PrintHello : UIViewController
-(void)Print;
@end
和PrintHello.m
-(void)Print
{
[self URL];
}
-(void)URL
{
NSString *strURL=[NSString stringWithFormat:@"http://arproject.site90.com/jsonbuilding.php"];
NSLog(@"%@",strURL);
}
在viewcontroller.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.printMessage = [[PrintHello alloc]init];
}
-(IBAction)Button01
{
NSString *url=[self.printMessage Print];
NSString *strURL=[NSString stringWithFormat:@"%@",url];
NSLog(@"%@",strURL);
}
我误解了什么 我想从PrintHello发送url 我需要做什么? 请帮忙 谢谢
问题不清楚。 – Pawan
如何将PrintHello切换到viewcontroller? – Seeker
嘿检查返回类型。 –