我是一名新的 iPhone 开发人员,我正在用 Objective-C 语言练习调用函数。有人可以帮助我吗?有我的节目详情。谢谢!
#import <UIKit/UIKit.h>
@interface TestingProgramViewController : UIViewController{
NSTimer *aTimer;
id getPic;
}
@end
#import "TestingProgramViewController.h"
@interface TestingProgramViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *testingPic;
@end
@implementation TestingProgramViewController
- (void) obtainPic:(NSString *)picName{
NSString *urlLink = [[NSString alloc] initWithFormat:@"http://tdcctv.data.one.gov.hk/, %@!", picName];
NSURL *url = [NSURL URLWithString:urlLink];
UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
self.testingPic.image = image;
}
- (void)viewDidLoad
{
[super viewDidLoad];
[getPic obtainPic:@"H422F2.JPG"];
}