I have an app that I want options of viewing audio or video podcast of our podcast. I don't want the clutter of a segmented controller or adding another control in the app so i decided i would do this by adding a settings bundle. I have it working, just with an issue of having to kill the app completely after changing settings to get different podcast to appear. Any suggestions for doing this without having to completely restart app?
I set up the plist with a PSMultiValueSpecifier and key of defaultTab. I set up an Array under this with Titles of Audio Podcast and Video Podcast, the values I made a string for testing of http://www.google.com and http://www.yahoo.com. In the viewController being used I have this as my viewDidLoad code:
This works for me, and it will use google.com as default, and I can change it in the Settings window, but here is where I run into a bit of an issue. If I do not kill the app in the multi-tasking bar, it won't change after I change it in the settings app. Once I completely kill the app, and restart it, it will load the different view. Is there a way I can make it change without having to kill app completely?
I set up the plist with a PSMultiValueSpecifier and key of defaultTab. I set up an Array under this with Titles of Audio Podcast and Video Podcast, the values I made a string for testing of http://www.google.com and http://www.yahoo.com. In the viewController being used I have this as my viewDidLoad code:
Code:
- (void)awakeFromNib
{
NSString *path = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultTab"];
Reachability *reachability = [Reachability reachabilityWithHostName:@"google.com"];
NetworkStatus status = [reachability currentReachabilityStatus];
if (status == ReachableViaWiFi) {
[sermons loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:path]]];
reload.hidden=YES;
sermons.hidden=NO;
}
else {
UIAlertView *cancelled = [[UIAlertView alloc] initWithTitle:@"Wifi Required" message:@"To listen to the sermons, you must be connected to a Wifi Network. After connecting to a Wifi Network, press the 'Reload Sermons Page' button (located in Sermons tab) to try again. You may also download sermons via iTunes app from our official Podcast." delegate:self cancelButtonTitle:@"Open in iTunes" otherButtonTitles:@"Dismiss", nil];
[cancelled show];
[cancelled release];
reload.hidden=NO;
sermons.hidden=YES;
}
timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(tick) userInfo:nil repeats:YES];
}