I'm trying to simple update some text on an app created at my firm before my time. The app is a native iOS app and I'm not familiar with objective C so I'm not sure how to search for these solutions.
I have the following code:
- (IBAction)PlayFirstVideo:(id)sender {
// allocate a reachability object
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
// set the blocks
reach.reachableBlock = ^(Reachability*reach)
{
dispatch_async(dispatch_get_main_queue(), ^{
NSString *url = @"http://domainname.com/tvxcode/tomatobasilsequence/tomatobasil_all.m3u8";
videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
[self.view addSubview:videoPlayer.view];
videoPlayer.view.frame = CGRectMake(359, 0, 665, 375);
[videoPlayer play];
});
};
reach.unreachableBlock = ^(Reachability*reach)
{
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView *noConnection = [[UIAlertView alloc] initWithTitle:@"Connection Required"
message:@"An internet connection is required to view videos."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[noConnection show];
});
};
// start the notifier which will cause the reachability object to retain itself!
[reach startNotifier];
}
This generates three errors:
- No known class method for selector 'reachabilityWithHostname:'
- Property 'reachableBlock' not found on object of type 'Reachability *'
- Property 'unreachableBlock' not found on object of type 'Reachability *'
My real question is obviously how to fix this, however I'm not even sure if those are custom classes or not. They don't seem to match the previous developer's name styles and habits so if that's the case is this a problem because I updated xCode?