@interface MyViewController () {
NSTimer *timer;
int seconds;
...
}
@property (weak, nonatomic) IBOutlet UILabel *timerLabel;
@end
...
- (void)viewDidLoad
{
[super viewDidLoad];
timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(updateTimer:) userInfo:nil repeats:YES];
seconds = 0;
}
- (void)updateTimer:(NSTimer *)theTimer {
[functions playSound:[NSString stringWithFormat:@"%@",seconds] ofType:@"aac"];
seconds++;
}
NSString *myURLString = @"http://google.com";
NSURL *myURL = [NSURL URLWithString:myURLString];
NSError *error = nil;
NSString *myHTMLString = [NSString stringWithContentsOfURL:myURL encoding: NSUTF8StringEncoding error:&error];
if (error != nil)
{
NSLog(@"Error : %@", error);
}
else
{
NSLog(@"HTML : %@", myHTMLString);
}