Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing a lot of bugs

Refreshing system improved + online check
  • Loading branch information...
commit 0be87c343da0e93cf1d5fc5a81ccc7d51dd995f3 1 parent f0367ae
Frederic Jacobs authored
Showing with 1,096 additions and 315 deletions.
  1. BIN  .DS_Store
  2. BIN  App Icon for iStore.png
  3. BIN  Default.png
  4. BIN  Default@2x.png
  5. BIN  Icon.png
  6. BIN  Icon@2x.png
  7. +18 −0 LaunchTest.h
  8. +67 −0 LaunchTest.m
  9. +206 −0 LaunchTest.xib
  10. +9 −20 MainWindow.xib
  11. +88 −0 Reachability.h
  12. +273 −0 Reachability.m
  13. +27 −0 RootTabBarController.h
  14. +136 −0 RootTabBarController.m
  15. +22 −1 SecondViewController.h
  16. +132 −1 SecondViewController.m
  17. +46 −7 SecondViewController.xib
  18. BIN  UCLMainScreen.png
  19. BIN  UCLMainScreen@2x.png
  20. +50 −4 UCLRadio.xcodeproj/project.pbxproj
  21. BIN  UCLRadio.xcodeproj/project.xcworkspace/xcuserdata/fredericjacobs.xcuserdatad/UserInterfaceState.xcuserstate
  22. +3 −3 UCLRadio.xcodeproj/xcuserdata/fredericjacobs.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  23. +1 −9 UCLRadio/AppDelegate.h
  24. +2 −19 UCLRadio/AppDelegate.m
  25. +1 −3 UCLRadio/UCLRadio-Info.plist
  26. +9 −139 UCLRadio/UCLRadioViewController.xib
  27. +3 −5 UCLRadioViewController.h
  28. +3 −104 UCLRadioViewController.m
  29. BIN  arrow.png
  30. BIN  loadingbutton.png
  31. BIN  playbutton.png
  32. BIN  stopbutton.png
View
BIN  .DS_Store
Binary file not shown
View
BIN  App Icon for iStore.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Icon@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
18 LaunchTest.h
@@ -0,0 +1,18 @@
+//
+// LaunchTest.h
+// UCLRadio
+//
+// Created by Frederic Jacobs on 1/26/12.
+// Copyright (c) 2012 EPFL. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface LaunchTest : UIViewController{
+ IBOutlet UILabel *statusLabel;
+
+}
+
+@property (nonatomic, retain) IBOutlet UILabel *statusLabel;
+
+@end
View
67 LaunchTest.m
@@ -0,0 +1,67 @@
+//
+// LaunchTest.m
+// UCLRadio
+//
+// Created by Frederic Jacobs on 1/26/12.
+// Copyright (c) 2012 EPFL. All rights reserved.
+//
+
+#import "LaunchTest.h"
+#import "AppDelegate.h"
+@implementation LaunchTest
+@synthesize statusLabel;
+
+
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+
+- (void)didReceiveMemoryWarning
+{
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void) viewWillDisappear:(BOOL)animated
+{
+
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+}
+
+-(void) viewWillAppear:(BOOL)animated
+{
+
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view from its nib.
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+@end
View
206 LaunchTest.xib
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">933</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBUIActivityIndicatorView</string>
+ <string>IBUIView</string>
+ <string>IBUILabel</string>
+ <string>IBProxyObject</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUILabel" id="430746861">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 211}, {280, 189}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:328</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Loading</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUINumberOfLines">17</int>
+ <int key="IBUITextAlignment">1</int>
+ <int key="IBUILineBreakMode">2</int>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">1</int>
+ <double key="pointSize">17</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">17</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ </object>
+ <object class="IBUIActivityIndicatorView" id="723016688">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{150, 220}, {20, 20}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="430746861"/>
+ <string key="NSReuseIdentifierKey">_NS:1030</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHidesWhenStopped">NO</bool>
+ <bool key="IBUIAnimating">YES</bool>
+ <int key="IBUIStyle">2</int>
+ </object>
+ </array>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="723016688"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">statusLabel</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="430746861"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="723016688"/>
+ <reference ref="430746861"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="723016688"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="430746861"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">LaunchTest</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">10</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">LaunchTest</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">statusLabel</string>
+ <string key="NS.object.0">UILabel</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">statusLabel</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">statusLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/LaunchTest.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">933</string>
+ </data>
+</archive>
View
29 MainWindow.xib 100644 → 100755
@@ -134,6 +134,7 @@
<int key="NSvFlags">266</int>
<string key="NSFrame">{{0, 431}, {320, 49}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:473</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@@ -143,9 +144,11 @@
</object>
</object>
<object class="IBUIWindow" id="117978783">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
@@ -173,23 +176,7 @@
<reference key="source" ref="117978783"/>
<reference key="destination" ref="170853733"/>
</object>
- <int key="connectionID">52</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">viewController</string>
- <reference key="source" ref="1013181473"/>
- <reference key="destination" ref="62223111"/>
- </object>
- <int key="connectionID">48</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">secondViewController</string>
- <reference key="source" ref="1013181473"/>
- <reference key="destination" ref="165672799"/>
- </object>
- <int key="connectionID">49</int>
+ <int key="connectionID">64</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
@@ -197,7 +184,7 @@
<reference key="source" ref="170853733"/>
<reference key="destination" ref="1013181473"/>
</object>
- <int key="connectionID">50</int>
+ <int key="connectionID">63</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -319,6 +306,7 @@
<string>12.IBPluginDependency</string>
<string>26.CustomClassName</string>
<string>26.IBPluginDependency</string>
+ <string>28.CustomClassName</string>
<string>28.IBPluginDependency</string>
<string>29.IBPluginDependency</string>
<string>31.CustomClassName</string>
@@ -341,6 +329,7 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>AppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>RootTabBarController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>SecondViewController</string>
@@ -367,7 +356,7 @@
<reference key="dict.values" ref="957960031"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">52</int>
+ <int key="maxID">65</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
View
88 Reachability.h
@@ -0,0 +1,88 @@
+/*
+
+ File: Reachability.h
+ Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
+
+ Version: 2.2
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
+ ("Apple") in consideration of your agreement to the following terms, and your
+ use, installation, modification or redistribution of this Apple software
+ constitutes acceptance of these terms. If you do not agree with these terms,
+ please do not use, install, modify or redistribute this Apple software.
+
+ In consideration of your agreement to abide by the following terms, and subject
+ to these terms, Apple grants you a personal, non-exclusive license, under
+ Apple's copyrights in this original Apple software (the "Apple Software"), to
+ use, reproduce, modify and redistribute the Apple Software, with or without
+ modifications, in source and/or binary forms; provided that if you redistribute
+ the Apple Software in its entirety and without modifications, you must retain
+ this notice and the following text and disclaimers in all such redistributions
+ of the Apple Software.
+ Neither the name, trademarks, service marks or logos of Apple Inc. may be used
+ to endorse or promote products derived from the Apple Software without specific
+ prior written permission from Apple. Except as expressly stated in this notice,
+ no other rights or licenses, express or implied, are granted by Apple herein,
+ including but not limited to any patent rights that may be infringed by your
+ derivative works or by other works in which the Apple Software may be
+ incorporated.
+
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
+ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
+ CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
+ APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Copyright (C) 2010 Apple Inc. All Rights Reserved.
+
+*/
+
+
+#import <Foundation/Foundation.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+#import <netinet/in.h>
+typedef enum {
+ NotReachable = 0,
+ ReachableViaWiFi,
+ ReachableViaWWAN
+} NetworkStatus;
+#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification"
+
+@interface Reachability: NSObject
+{
+ BOOL localWiFiRef;
+ SCNetworkReachabilityRef reachabilityRef;
+}
+
+//reachabilityWithHostName- Use to check the reachability of a particular host name.
++ (Reachability*) reachabilityWithHostName: (NSString*) hostName;
+
+//reachabilityWithAddress- Use to check the reachability of a particular IP address.
++ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
+
+//reachabilityForInternetConnection- checks whether the default route is available.
+// Should be used by applications that do not connect to a particular host
++ (Reachability*) reachabilityForInternetConnection;
+
+//reachabilityForLocalWiFi- checks whether a local wifi connection is available.
++ (Reachability*) reachabilityForLocalWiFi;
+
+//Start listening for reachability notifications on the current run loop
+- (BOOL) startNotifier;
+- (void) stopNotifier;
+
+- (NetworkStatus) currentReachabilityStatus;
+//WWAN may be available, but not active until a connection has been established.
+//WiFi may require a connection for VPN on Demand.
+- (BOOL) connectionRequired;
+@end
+
+
View
273 Reachability.m
@@ -0,0 +1,273 @@
+/*
+
+ File: Reachability.m
+ Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
+
+ Version: 2.2
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
+ ("Apple") in consideration of your agreement to the following terms, and your
+ use, installation, modification or redistribution of this Apple software
+ constitutes acceptance of these terms. If you do not agree with these terms,
+ please do not use, install, modify or redistribute this Apple software.
+
+ In consideration of your agreement to abide by the following terms, and subject
+ to these terms, Apple grants you a personal, non-exclusive license, under
+ Apple's copyrights in this original Apple software (the "Apple Software"), to
+ use, reproduce, modify and redistribute the Apple Software, with or without
+ modifications, in source and/or binary forms; provided that if you redistribute
+ the Apple Software in its entirety and without modifications, you must retain
+ this notice and the following text and disclaimers in all such redistributions
+ of the Apple Software.
+ Neither the name, trademarks, service marks or logos of Apple Inc. may be used
+ to endorse or promote products derived from the Apple Software without specific
+ prior written permission from Apple. Except as expressly stated in this notice,
+ no other rights or licenses, express or implied, are granted by Apple herein,
+ including but not limited to any patent rights that may be infringed by your
+ derivative works or by other works in which the Apple Software may be
+ incorporated.
+
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
+ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
+ CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
+ APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Copyright (C) 2010 Apple Inc. All Rights Reserved.
+
+*/
+
+#import <sys/socket.h>
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+
+#import <CoreFoundation/CoreFoundation.h>
+
+#import "Reachability.h"
+
+#define kShouldPrintReachabilityFlags 1
+
+static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment)
+{
+#if kShouldPrintReachabilityFlags
+
+ NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n",
+ (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-',
+ (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-',
+
+ (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-',
+ (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-',
+ (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-',
+ (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',
+ (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-',
+ (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-',
+ (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-',
+ comment
+ );
+#endif
+}
+
+
+@implementation Reachability
+static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
+{
+ #pragma unused (target, flags)
+ NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
+ NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback");
+
+ //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively
+ // in case someon uses the Reachablity object in a different thread.
+ NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init];
+
+ Reachability* noteObject = (Reachability*) info;
+ // Post a notification to notify the client that the network reachability changed.
+ [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];
+
+ [myPool release];
+}
+
+- (BOOL) startNotifier
+{
+ BOOL retVal = NO;
+ SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL};
+ if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context))
+ {
+ if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode))
+ {
+ retVal = YES;
+ }
+ }
+ return retVal;
+}
+
+- (void) stopNotifier
+{
+ if(reachabilityRef!= NULL)
+ {
+ SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
+ }
+}
+
+- (void) dealloc
+{
+ [self stopNotifier];
+ if(reachabilityRef!= NULL)
+ {
+ CFRelease(reachabilityRef);
+ }
+ [super dealloc];
+}
+
++ (Reachability*) reachabilityWithHostName: (NSString*) hostName;
+{
+ Reachability* retVal = NULL;
+ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]);
+ if(reachability!= NULL)
+ {
+ retVal= [[[self alloc] init] autorelease];
+ if(retVal!= NULL)
+ {
+ retVal->reachabilityRef = reachability;
+ retVal->localWiFiRef = NO;
+ }
+ }
+ return retVal;
+}
+
++ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
+{
+ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
+ Reachability* retVal = NULL;
+ if(reachability!= NULL)
+ {
+ retVal= [[[self alloc] init] autorelease];
+ if(retVal!= NULL)
+ {
+ retVal->reachabilityRef = reachability;
+ retVal->localWiFiRef = NO;
+ }
+ }
+ return retVal;
+}
+
++ (Reachability*) reachabilityForInternetConnection;
+{
+ struct sockaddr_in zeroAddress;
+ bzero(&zeroAddress, sizeof(zeroAddress));
+ zeroAddress.sin_len = sizeof(zeroAddress);
+ zeroAddress.sin_family = AF_INET;
+ return [self reachabilityWithAddress: &zeroAddress];
+}
+
++ (Reachability*) reachabilityForLocalWiFi;
+{
+ struct sockaddr_in localWifiAddress;
+ bzero(&localWifiAddress, sizeof(localWifiAddress));
+ localWifiAddress.sin_len = sizeof(localWifiAddress);
+ localWifiAddress.sin_family = AF_INET;
+ // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0
+ localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
+ Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress];
+ if(retVal!= NULL)
+ {
+ retVal->localWiFiRef = YES;
+ }
+ return retVal;
+}
+
+#pragma mark Network Flag Handling
+
+- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags
+{
+ PrintReachabilityFlags(flags, "localWiFiStatusForFlags");
+
+ BOOL retVal = NotReachable;
+ if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect))
+ {
+ retVal = ReachableViaWiFi;
+ }
+ return retVal;
+}
+
+- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags
+{
+ PrintReachabilityFlags(flags, "networkStatusForFlags");
+ if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)
+ {
+ // if target host is not reachable
+ return NotReachable;
+ }
+
+ BOOL retVal = NotReachable;
+
+ if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)
+ {
+ // if target host is reachable and no connection is required
+ // then we'll assume (for now) that your on Wi-Fi
+ retVal = ReachableViaWiFi;
+ }
+
+
+ if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) ||
+ (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0))
+ {
+ // ... and the connection is on-demand (or on-traffic) if the
+ // calling application is using the CFSocketStream or higher APIs
+
+ if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0)
+ {
+ // ... and no [user] intervention is needed
+ retVal = ReachableViaWiFi;
+ }
+ }
+
+ if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN)
+ {
+ // ... but WWAN connections are OK if the calling application
+ // is using the CFNetwork (CFSocketStream?) APIs.
+ retVal = ReachableViaWWAN;
+ }
+ return retVal;
+}
+
+- (BOOL) connectionRequired;
+{
+ NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef");
+ SCNetworkReachabilityFlags flags;
+ if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
+ {
+ return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
+ }
+ return NO;
+}
+
+- (NetworkStatus) currentReachabilityStatus
+{
+ NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef");
+ NetworkStatus retVal = NotReachable;
+ SCNetworkReachabilityFlags flags;
+ if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
+ {
+ if(localWiFiRef)
+ {
+ retVal = [self localWiFiStatusForFlags: flags];
+ }
+ else
+ {
+ retVal = [self networkStatusForFlags: flags];
+ }
+ }
+ return retVal;
+}
+@end
View
27 RootTabBarController.h
@@ -0,0 +1,27 @@
+//
+// RootTabBarController.h
+// UCLRadio
+//
+// Created by Frederic Jacobs on 1/26/12.
+// Copyright (c) 2012 EPFL. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "LaunchTest.h"
+@class Reachability;
+
+
+@interface RootTabBarController : UITabBarController{
+ Reachability* internetReachable;
+ Reachability* hostReachable;
+ BOOL internetActive;
+ BOOL hostActive;
+ LaunchTest *launchTest;
+
+}
+@property (nonatomic) BOOL internetActive;
+@property (nonatomic) BOOL hostActive;
+
+- (void) checkNetworkStatus:(NSNotification *)notice;
+
+@end
View
136 RootTabBarController.m
@@ -0,0 +1,136 @@
+//
+// RootTabBarController.m
+// UCLRadio
+//
+// Created by Frederic Jacobs on 1/26/12.
+// Copyright (c) 2012 EPFL. All rights reserved.
+//
+
+#import "RootTabBarController.h"
+#import "LaunchTest.h"
+#import "Reachability.h"
+#import "AppDelegate.h"
+
+@implementation RootTabBarController
+@synthesize internetActive, hostActive;
+
+-(void) viewDidAppear:(BOOL)animated{
+
+
+ // check for internet connection
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
+
+ internetReachable = [[Reachability reachabilityForInternetConnection] retain];
+ [internetReachable startNotifier];
+
+ // check if a pathway to a random host exists
+ hostReachable = [[Reachability reachabilityWithHostName: @"www.apple.com"] retain];
+ [hostReachable startNotifier];
+ // now patiently wait for the notification
+}
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)didReceiveMemoryWarning
+{
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+/*
+// Implement loadView to create a view hierarchy programmatically, without using a nib.
+- (void)loadView
+{
+}
+*/
+
+- (void) checkNetworkStatus:(NSNotification *)notice{
+ // called after network status changes
+
+ NetworkStatus internetStatus = [internetReachable currentReachabilityStatus];
+ switch (internetStatus)
+
+ {
+ case NotReachable:
+ {
+ launchTest = [[LaunchTest alloc] initWithNibName:@"LaunchTest" bundle:nil];
+ [self presentViewController:launchTest animated:NO completion:nil];
+ NSLog(@"The internet is down.");
+ self.internetActive = NO;
+ launchTest.statusLabel.text = @"This app needs a working internet connection to work. Relaunch the app when online.";
+ break;
+ }
+ case ReachableViaWiFi:
+ {
+ [self dismissViewControllerAnimated:YES completion:nil];
+ NSLog(@"The internet is working via WIFI.");
+ self.internetActive = YES;
+ break ;
+ }
+ case ReachableViaWWAN:
+ {
+ [self dismissViewControllerAnimated:YES completion:nil];
+ NSLog(@"The internet is working via WWAN.");
+ self.internetActive = YES;
+ break ;
+
+ }
+ }
+
+ NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
+ switch (hostStatus)
+
+ {
+ case NotReachable:
+ {
+ NSLog(@"A gateway to the host server is down.");
+ self.hostActive = NO;
+
+ break;
+
+ }
+ case ReachableViaWiFi:
+ {
+ NSLog(@"A gateway to the host server is working via WIFI.");
+ self.hostActive = YES;
+
+ break;
+
+ }
+ case ReachableViaWWAN:
+ {
+ NSLog(@"A gateway to the host server is working via WWAN.");
+ self.hostActive = YES;
+
+ break;
+
+ }
+ }
+}
+
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+@end
View
23 SecondViewController.h
@@ -15,12 +15,33 @@
IBOutlet UITableView *allShows;
NSMutableArray *shows;
DetailController *detailController;
-
+ UIView *refreshHeaderView;
+ UILabel *refreshLabel;
+ UIImageView *refreshArrow;
+ UIActivityIndicatorView *refreshSpinner;
+ BOOL isDragging;
+ BOOL isLoading;
+ NSString *textPull;
+ NSString *textRelease;
+ NSString *textLoading;
}
@property (nonatomic, retain, readonly) DetailController *detailController;
@property (nonatomic, retain) NSMutableArray *shows;
+@property (nonatomic, retain) UIView *refreshHeaderView;
+@property (nonatomic, retain) UILabel *refreshLabel;
+@property (nonatomic, retain) UIImageView *refreshArrow;
+@property (nonatomic, retain) UIActivityIndicatorView *refreshSpinner;
+@property (nonatomic, copy) NSString *textPull;
+@property (nonatomic, copy) NSString *textRelease;
+@property (nonatomic, copy) NSString *textLoading;
+- (void)setupStrings;
+- (void)addPullToRefreshHeader;
+- (void)startLoading;
+- (void)stopLoading;
+- (void)refresh;
+
@end
View
133 SecondViewController.m
@@ -8,13 +8,23 @@
#import "SecondViewController.h"
#import "DetailController.h"
+#import <QuartzCore/QuartzCore.h>
+
+
+#define REFRESH_HEADER_HEIGHT 52.0f
@implementation SecondViewController
@synthesize shows;
+@synthesize textPull, textRelease, textLoading, refreshHeaderView, refreshLabel, refreshArrow, refreshSpinner;
- (id) init{
self = [super initWithStyle:UITableViewStyleGrouped];
+
+ if (self != nil) {
+ [self setupStrings];
+ }
+
return self;
}
@@ -50,10 +60,121 @@ - (void)didReceiveMemoryWarning
// Release any cached data, images, etc that aren't in use.
}
+- (void)setupStrings{
+ textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."];
+ textRelease = [[NSString alloc] initWithString:@"Release to refresh..."];
+ textLoading = [[NSString alloc] initWithString:@"Loading..."];
+}
+- (void)addPullToRefreshHeader {
+ refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, 320, REFRESH_HEADER_HEIGHT)];
+ refreshHeaderView.backgroundColor = [UIColor grayColor];
+
+ refreshLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, REFRESH_HEADER_HEIGHT)];
+ refreshLabel.backgroundColor = [UIColor clearColor];
+ refreshLabel.font = [UIFont boldSystemFontOfSize:12.0];
+ refreshLabel.textAlignment = UITextAlignmentCenter;
+
+ refreshArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]];
+ refreshArrow.frame = CGRectMake(floorf((REFRESH_HEADER_HEIGHT - 27) / 2),
+ (floorf(REFRESH_HEADER_HEIGHT - 44) / 2),
+ 27, 44);
+
+ refreshSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
+ refreshSpinner.frame = CGRectMake(floorf(floorf(REFRESH_HEADER_HEIGHT - 20) / 2), floorf((REFRESH_HEADER_HEIGHT - 20) / 2), 20, 20);
+ refreshSpinner.hidesWhenStopped = YES;
+
+ [refreshHeaderView addSubview:refreshLabel];
+ [refreshHeaderView addSubview:refreshArrow];
+ [refreshHeaderView addSubview:refreshSpinner];
+ [self.tableView addSubview:refreshHeaderView];
+}
+- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
+ if (isLoading) return;
+ isDragging = YES;
+}
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
+ if (isLoading) {
+ // Update the content inset, good for section headers
+ if (scrollView.contentOffset.y > 0)
+ self.tableView.contentInset = UIEdgeInsetsZero;
+ else if (scrollView.contentOffset.y >= -REFRESH_HEADER_HEIGHT)
+ self.tableView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
+ } else if (isDragging && scrollView.contentOffset.y < 0) {
+ // Update the arrow direction and label
+ [UIView beginAnimations:nil context:NULL];
+ if (scrollView.contentOffset.y < -REFRESH_HEADER_HEIGHT) {
+ // User is scrolling above the header
+ refreshLabel.text = self.textRelease;
+ [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI, 0, 0, 1);
+ } else { // User is scrolling somewhere within the header
+ refreshLabel.text = self.textPull;
+ [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1);
+ }
+ [UIView commitAnimations];
+ }
+}
+
+- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
+ if (isLoading) return;
+ isDragging = NO;
+ if (scrollView.contentOffset.y <= -REFRESH_HEADER_HEIGHT) {
+ // Released above the header
+ [self startLoading];
+ }
+}
+
+- (void)startLoading {
+ isLoading = YES;
+
+ // Show the header
+ [UIView beginAnimations:nil context:NULL];
+ [UIView setAnimationDuration:0.3];
+ self.tableView.contentInset = UIEdgeInsetsMake(REFRESH_HEADER_HEIGHT, 0, 0, 0);
+ refreshLabel.text = self.textLoading;
+ refreshArrow.hidden = YES;
+ [refreshSpinner startAnimating];
+ [UIView commitAnimations];
+
+ // Refresh action!
+ [self refresh];
+}
+
+- (void)stopLoading {
+ isLoading = NO;
+
+ // Hide the header
+ [UIView beginAnimations:nil context:NULL];
+ [UIView setAnimationDelegate:self];
+ [UIView setAnimationDuration:0.3];
+ [UIView setAnimationDidStopSelector:@selector(stopLoadingComplete:finished:context:)];
+ self.tableView.contentInset = UIEdgeInsetsZero;
+ UIEdgeInsets tableContentInset = self.tableView.contentInset;
+ tableContentInset.top = 0.0;
+ self.tableView.contentInset = tableContentInset;
+ [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1);
+ [UIView commitAnimations];
+}
+
+- (void)stopLoadingComplete:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
+ // Reset the header
+ refreshLabel.text = self.textPull;
+ refreshArrow.hidden = NO;
+ [refreshSpinner stopAnimating];
+}
+
+- (void)refresh {
+ // This is just a demo. Override this method with your custom reload action.
+ // Don't forget to call stopLoading at the end.
+ [self performSelector:@selector(stopLoading) withObject:nil afterDelay:2.0];
+}
+
+
#pragma mark - View lifecycle
-- (void)viewDidLoad
+- (void)viewDidAppear:(BOOL)animated
{
+ [self addPullToRefreshHeader];
AppDelegate *appDelegate;
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
@@ -120,6 +241,16 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
+- (void)dealloc {
+ [refreshHeaderView release];
+ [refreshLabel release];
+ [refreshArrow release];
+ [refreshSpinner release];
+ [textPull release];
+ [textRelease release];
+ [textLoading release];
+ [super dealloc];
+}
View
53 SecondViewController.xib
@@ -11,12 +11,13 @@
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
- <string>IBUINavigationItem</string>
+ <string>IBProxyObject</string>
+ <string>IBUINavigationController</string>
<string>IBUIViewController</string>
- <string>IBUITableView</string>
+ <string>IBUIBarButtonItem</string>
<string>IBUINavigationBar</string>
- <string>IBUINavigationController</string>
- <string>IBProxyObject</string>
+ <string>IBUINavigationItem</string>
+ <string>IBUITableView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -60,7 +61,7 @@
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 64}, {320, 416}}</string>
<reference key="NSSuperview"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:418</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@@ -77,7 +78,14 @@
<float key="IBUISectionFooterHeight">22</float>
</object>
<object class="IBUINavigationItem" key="IBUINavigationItem" id="93248673">
+ <reference key="IBUINavigationBar"/>
<string key="IBUITitle">All Shows</string>
+ <object class="IBUIBarButtonItem" key="IBUIRightBarButtonItem" id="448225334">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIStyle">1</int>
+ <reference key="IBUINavigationItem" ref="93248673"/>
+ <int key="IBUISystemItemIdentifier">13</int>
+ </object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="85656930"/>
@@ -179,6 +187,9 @@
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="93248673"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="448225334"/>
+ </array>
<reference key="parent" ref="848449117"/>
</object>
<object class="IBObjectRecord">
@@ -186,6 +197,11 @@
<reference key="object" ref="173939279"/>
<reference key="parent" ref="848449117"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">27</int>
+ <reference key="object" ref="448225334"/>
+ <reference key="parent" ref="93248673"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -199,14 +215,37 @@
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="16.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">26</int>
+ <int key="maxID">27</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">SecondViewController</string>
+ <string key="superclassName">UITableViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">allShows</string>
+ <string key="NS.object.0">UITableView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">allShows</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">allShows</string>
+ <string key="candidateClassName">UITableView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/SecondViewController.h</string>
+ </object>
+ </object>
+ </array>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
View
BIN  UCLMainScreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  UCLMainScreen@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
54 UCLRadio.xcodeproj/project.pbxproj
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ F406FACE14D16624004B7AE0 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = F406FACD14D16624004B7AE0 /* Reachability.m */; };
+ F406FAD014D1667C004B7AE0 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F406FACF14D1667C004B7AE0 /* SystemConfiguration.framework */; };
+ F406FAD414D166DE004B7AE0 /* LaunchTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F406FAD214D166DE004B7AE0 /* LaunchTest.m */; };
+ F406FAD514D166DE004B7AE0 /* LaunchTest.xib in Resources */ = {isa = PBXBuildFile; fileRef = F406FAD314D166DE004B7AE0 /* LaunchTest.xib */; };
F4334D4A147E9C0B004DC63D /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F4334D48147E9C0B004DC63D /* Icon@2x.png */; };
F4334D4B147E9C0B004DC63D /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = F4334D49147E9C0B004DC63D /* Icon.png */; };
F4522447147E88BB000A94F5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4522446147E88BB000A94F5 /* UIKit.framework */; };
@@ -36,19 +40,27 @@
F4522490147E89BF000A94F5 /* SecondViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F452248E147E89BF000A94F5 /* SecondViewController.xib */; };
F4522493147E8A11000A94F5 /* DetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4522492147E8A11000A94F5 /* DetailController.m */; };
F4522495147E8B46000A94F5 /* UCLRadioViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4522494147E8B46000A94F5 /* UCLRadioViewController.xib */; };
- F4522497147E8B59000A94F5 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4522496147E8B59000A94F5 /* MainWindow.xib */; };
F45224B6147E90CA000A94F5 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45224B3147E90A9000A94F5 /* CFNetwork.framework */; };
F45224B7147E90CA000A94F5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45224B1147E909D000A94F5 /* QuartzCore.framework */; };
F45224BA147E90DF000A94F5 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45224B8147E90D6000A94F5 /* MediaPlayer.framework */; };
F45224CB147E9329000A94F5 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45224C9147E927E000A94F5 /* AudioToolbox.framework */; };
F45224CC147E936D000A94F5 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45224A5147E8F75000A94F5 /* AVFoundation.framework */; };
F45224CF147E9386000A94F5 /* Twitter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45224CD147E937C000A94F5 /* Twitter.framework */; };
+ F4554D2D14D1DC8A00843AD1 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4554D2C14D1DC8A00843AD1 /* MainWindow.xib */; };
+ F4554D3014D1E2EE00843AD1 /* RootTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4554D2F14D1E2EE00843AD1 /* RootTabBarController.m */; };
+ F4554D3614D1F4AE00843AD1 /* arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = F4554D3514D1F4AE00843AD1 /* arrow.png */; };
F4A2A2AE1496A55B009B7D40 /* IsDonePlaying.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A2A2AD1496A55B009B7D40 /* IsDonePlaying.m */; };
F4CC507B147EA8A000530C84 /* loadingbutton.png in Resources */ = {isa = PBXBuildFile; fileRef = F4CC507A147EA8A000530C84 /* loadingbutton.png */; };
F4F43EAC14967D5C000A0B7F /* ShowsParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F4F43EAB14967D5C000A0B7F /* ShowsParser.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ F406FACC14D16624004B7AE0 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
+ F406FACD14D16624004B7AE0 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
+ F406FACF14D1667C004B7AE0 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ F406FAD114D166DE004B7AE0 /* LaunchTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchTest.h; sourceTree = "<group>"; };
+ F406FAD214D166DE004B7AE0 /* LaunchTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchTest.m; sourceTree = "<group>"; };
+ F406FAD314D166DE004B7AE0 /* LaunchTest.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchTest.xib; sourceTree = "<group>"; };
F4334D48147E9C0B004DC63D /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
F4334D49147E9C0B004DC63D /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
F4522442147E88BB000A94F5 /* UCLRadio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UCLRadio.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -89,13 +101,16 @@
F4522491147E8A11000A94F5 /* DetailController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailController.h; sourceTree = "<group>"; };
F4522492147E8A11000A94F5 /* DetailController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailController.m; sourceTree = "<group>"; };
F4522494147E8B46000A94F5 /* UCLRadioViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = UCLRadioViewController.xib; path = UCLRadio/UCLRadioViewController.xib; sourceTree = "<group>"; };
- F4522496147E8B59000A94F5 /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
F45224A5147E8F75000A94F5 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
F45224B1147E909D000A94F5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
F45224B3147E90A9000A94F5 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
F45224B8147E90D6000A94F5 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
F45224C9147E927E000A94F5 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
F45224CD147E937C000A94F5 /* Twitter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Twitter.framework; path = System/Library/Frameworks/Twitter.framework; sourceTree = SDKROOT; };
+ F4554D2C14D1DC8A00843AD1 /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
+ F4554D2E14D1E2EE00843AD1 /* RootTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootTabBarController.h; sourceTree = "<group>"; };
+ F4554D2F14D1E2EE00843AD1 /* RootTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootTabBarController.m; sourceTree = "<group>"; };
+ F4554D3514D1F4AE00843AD1 /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = "<group>"; };
F4A2A2AC1496A55B009B7D40 /* IsDonePlaying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsDonePlaying.h; sourceTree = "<group>"; };
F4A2A2AD1496A55B009B7D40 /* IsDonePlaying.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IsDonePlaying.m; sourceTree = "<group>"; };
F4CC507A147EA8A000530C84 /* loadingbutton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = loadingbutton.png; sourceTree = "<group>"; };
@@ -108,6 +123,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ F406FAD014D1667C004B7AE0 /* SystemConfiguration.framework in Frameworks */,
F45224CF147E9386000A94F5 /* Twitter.framework in Frameworks */,
F45224CC147E936D000A94F5 /* AVFoundation.framework in Frameworks */,
F4522449147E88BB000A94F5 /* Foundation.framework in Frameworks */,
@@ -123,9 +139,19 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ F406FACA14D165DA004B7AE0 /* Reachability */ = {
+ isa = PBXGroup;
+ children = (
+ F406FACC14D16624004B7AE0 /* Reachability.h */,
+ F406FACD14D16624004B7AE0 /* Reachability.m */,
+ );
+ name = Reachability;
+ sourceTree = "<group>";
+ };
F4334D45147E9BEA004DC63D /* Icons */ = {
isa = PBXGroup;
children = (
+ F4554D3514D1F4AE00843AD1 /* arrow.png */,
F4334D48147E9C0B004DC63D /* Icon@2x.png */,
F4334D49147E9C0B004DC63D /* Icon.png */,
);
@@ -176,6 +202,8 @@
F4522437147E88BB000A94F5 = {
isa = PBXGroup;
children = (
+ F49B652514D16CA3003A90F1 /* Launch Test */,
+ F406FACA14D165DA004B7AE0 /* Reachability */,
F452244C147E88BB000A94F5 /* UCLRadio */,
F452248B147E8990000A94F5 /* Views */,
F4522484147E8971000A94F5 /* Parser */,
@@ -197,6 +225,7 @@
F4522445147E88BB000A94F5 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ F406FACF14D1667C004B7AE0 /* SystemConfiguration.framework */,
F45224CD147E937C000A94F5 /* Twitter.framework */,
F45224C9147E927E000A94F5 /* AudioToolbox.framework */,
F45224B8147E90D6000A94F5 /* MediaPlayer.framework */,
@@ -270,7 +299,9 @@
F452248B147E8990000A94F5 /* Views */ = {
isa = PBXGroup;
children = (
- F4522496147E8B59000A94F5 /* MainWindow.xib */,
+ F4554D2C14D1DC8A00843AD1 /* MainWindow.xib */,
+ F4554D2E14D1E2EE00843AD1 /* RootTabBarController.h */,
+ F4554D2F14D1E2EE00843AD1 /* RootTabBarController.m */,
F4522494147E8B46000A94F5 /* UCLRadioViewController.xib */,
F4522462147E88F5000A94F5 /* UCLRadioViewController.h */,
F4522463147E88F5000A94F5 /* UCLRadioViewController.m */,
@@ -285,6 +316,16 @@
name = Views;
sourceTree = "<group>";
};
+ F49B652514D16CA3003A90F1 /* Launch Test */ = {
+ isa = PBXGroup;
+ children = (
+ F406FAD114D166DE004B7AE0 /* LaunchTest.h */,
+ F406FAD214D166DE004B7AE0 /* LaunchTest.m */,
+ F406FAD314D166DE004B7AE0 /* LaunchTest.xib */,
+ );
+ name = "Launch Test";
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -350,10 +391,12 @@
F452247F147E8932000A94F5 /* UCLMainScreen@2x.png in Resources */,
F4522490147E89BF000A94F5 /* SecondViewController.xib in Resources */,
F4522495147E8B46000A94F5 /* UCLRadioViewController.xib in Resources */,
- F4522497147E8B59000A94F5 /* MainWindow.xib in Resources */,
F4334D4A147E9C0B004DC63D /* Icon@2x.png in Resources */,
F4334D4B147E9C0B004DC63D /* Icon.png in Resources */,
F4CC507B147EA8A000530C84 /* loadingbutton.png in Resources */,
+ F406FAD514D166DE004B7AE0 /* LaunchTest.xib in Resources */,
+ F4554D2D14D1DC8A00843AD1 /* MainWindow.xib in Resources */,
+ F4554D3614D1F4AE00843AD1 /* arrow.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -375,6 +418,9 @@
F4522493147E8A11000A94F5 /* DetailController.m in Sources */,
F4F43EAC14967D5C000A0B7F /* ShowsParser.m in Sources */,
F4A2A2AE1496A55B009B7D40 /* IsDonePlaying.m in Sources */,
+ F406FACE14D16624004B7AE0 /* Reachability.m in Sources */,
+ F406FAD414D166DE004B7AE0 /* LaunchTest.m in Sources */,
+ F4554D3014D1E2EE00843AD1 /* RootTabBarController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN  UCLRadio.xcodeproj/project.xcworkspace/xcuserdata/fredericjacobs.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
6 UCLRadio.xcodeproj/xcuserdata/fredericjacobs.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -9,11 +9,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "UCLRadio/AppDelegate.m"
- timestampString = "345418968.007627"
+ timestampString = "349302471.604051"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "263"
- endingLineNumber = "263"
+ startingLineNumber = "249"
+ endingLineNumber = "249"
landmarkName = "-addShow:"
landmarkType = "5">
</FileBreakpoint>
View
10 UCLRadio/AppDelegate.h
@@ -10,27 +10,19 @@
#import "Show.h"
#import "ShowsParser.h"
-@class UCLRadioViewController;
-@class SecondViewController;
@interface AppDelegate : NSObject <UIApplicationDelegate> {
- IBOutlet UIViewController *rootViewController;
- UIWindow *window;
- IBOutlet UCLRadioViewController *viewController;
UIBackgroundTaskIdentifier bgTask;
- IBOutlet SecondViewController *secondViewController;
NSMutableArray *subscribedShows;
NSMutableArray *allShows;
ShowsParser *myParser;
}
-
@property (nonatomic, retain) IBOutlet UIWindow *window;
-@property (nonatomic, retain) IBOutlet UCLRadioViewController *viewController;
-@property (nonatomic, retain) IBOutlet SecondViewController *secondViewController;
@property (nonatomic, retain) NSMutableArray *subscribedShows;
@property (nonatomic, retain) NSMutableArray *allShows;
@property (nonatomic, retain) ShowsParser *myParser;
+
- (void) addShow: (Show *)newShow ;
- (void) removeShow: (Show*)newShow ;
- (void) initializeArray;
View
21 UCLRadio/AppDelegate.m
@@ -4,7 +4,7 @@
@implementation AppDelegate
@synthesize window;
-@synthesize viewController, secondViewController, subscribedShows, allShows, myParser;
+@synthesize subscribedShows, allShows, myParser;
- (void) initializeArray {
@@ -80,23 +80,7 @@ -(void) applicationWillEnterForeground:(UIApplication *)application{
-(void) applicationDidFinishLaunching:(UIApplication *)application{
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
myParser = [[ShowsParser alloc] init];
- [myParser startParsing];
- /*
- UILabel *myLabel = [[UILabel alloc]initWithFrame:CGRectMake(110,200 , 100, 30)];
- myLabel.textAlignment = UITextAlignmentCenter;
- myLabel.text = @"Loading ... ";
-
- UIViewController *aViewController =[[UIViewController alloc] init];
-
- aViewController.view = myLabel;
-
-
- APPEAR VIEW DURING LOADING
-
- [rootViewController presentModalViewController:aViewController animated:YES];
-
-
- */
+ [myParser startParsing];
}
@@ -281,7 +265,6 @@ - (void) updateNotifications{
}
- (void)dealloc {
- [viewController release];
[window release];
[super dealloc];
}
View
4 UCLRadio/UCLRadio-Info.plist
@@ -53,8 +53,6 @@
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- </array>
+ <array/>
</dict>
</plist>
View
148 UCLRadio/UCLRadioViewController.xib
@@ -11,9 +11,7 @@
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
- <string>IBUILabel</string>
<string>IBUIButton</string>
- <string>IBUIImageView</string>
<string>IBUIView</string>
<string>IBUITextField</string>
<string>IBProxyObject</string>
@@ -38,27 +36,10 @@
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
- <object class="IBUIImageView" id="458570708">
- <reference key="NSNextResponder" ref="774585933"/>
- <int key="NSvFlags">256</int>
- <string key="NSFrameSize">{320, 460}</string>
- <reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="49008089"/>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <int key="IBUIContentMode">4</int>
- <bool key="IBUIMultipleTouchEnabled">YES</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <object class="NSCustomResource" key="IBUIImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">UCLMainScreen.png</string>
- </object>
- </object>
<object class="IBUIButton" id="359629939">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">301</int>
- <string key="NSFrame">{{130, 285}, {51, 47}}</string>
+ <string key="NSFrame">{{130, 172}, {60, 60}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
@@ -94,10 +75,10 @@
<object class="IBUIButton" id="1038323370">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{82, 317}, {156, 37}}</string>
+ <string key="NSFrame">{{82, 352}, {156, 37}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="359629939"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -126,75 +107,11 @@
</object>
<reference key="IBUIFont" ref="210318635"/>
</object>
- <object class="IBUILabel" id="49008089">
- <reference key="NSNextResponder" ref="774585933"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{31, 141}, {259, 116}}</string>
- <reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="447558062"/>
- <string key="NSReuseIdentifierKey">_NS:328</string>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <int key="IBUIContentMode">1</int>
- <bool key="IBUIUserInteractionEnabled">NO</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <string key="IBUIText">Title</string>
- <object class="NSColor" key="IBUITextColor" id="451626488">
- <int key="NSColorSpace">1</int>
- <bytes key="NSRGB">MCAwIDAAA</bytes>
- </object>
- <nil key="IBUIHighlightedColor"/>
- <int key="IBUIBaselineAdjustment">1</int>
- <float key="IBUIMinimumFontSize">10</float>
- <int key="IBUINumberOfLines">2</int>
- <int key="IBUITextAlignment">1</int>
- <int key="IBUILineBreakMode">5</int>
- <object class="IBUIFontDescription" key="IBUIFontDescription">
- <string key="name">HelveticaNeue-LightItalic</string>
- <string key="family">Helvetica Neue</string>
- <int key="traits">1</int>
- <double key="pointSize">17</double>
- </object>
- <object class="NSFont" key="IBUIFont">
- <string key="NSName">HelveticaNeue-LightItalic</string>
- <double key="NSSize">17</double>
- <int key="NSfFlags">16</int>
- </object>
- </object>
- <object class="IBUILabel" id="447558062">
- <reference key="NSNextResponder" ref="774585933"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{65, 189}, {58, 21}}</string>
- <reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="1038323370"/>
- <string key="NSReuseIdentifierKey">_NS:328</string>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <int key="IBUIContentMode">7</int>
- <bool key="IBUIUserInteractionEnabled">NO</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <string key="IBUIText">next up</string>
- <reference key="IBUITextColor" ref="451626488"/>
- <nil key="IBUIHighlightedColor"/>
- <int key="IBUIBaselineAdjustment">1</int>
- <float key="IBUIMinimumFontSize">10</float>
- <object class="IBUIFontDescription" key="IBUIFontDescription">
- <int key="type">1</int>
- <double key="pointSize">17</double>
- </object>
- <object class="NSFont" key="IBUIFont">
- <string key="NSName">Helvetica</string>
- <double key="NSSize">17</double>
- <int key="NSfFlags">16</int>
- </object>
- </object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="458570708"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC44NTIwNDA4MyAwLjg1MjA0MDgzIDAuODUyMDQwODMAA</bytes>
@@ -266,22 +183,6 @@
<int key="connectionID">11</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">nameOfTheShow</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="49008089"/>
- </object>
- <int key="connectionID">24</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">nextUp</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="447558062"/>
- </object>
- <int key="connectionID">26</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">buttonPressed:</string>
<reference key="source" ref="359629939"/>
@@ -331,20 +232,12 @@
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
<array class="NSMutableArray" key="children">
- <reference ref="458570708"/>
- <reference ref="359629939"/>
<reference ref="1038323370"/>
- <reference ref="49008089"/>
- <reference ref="447558062"/>
+ <reference ref="359629939"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">17</int>
- <reference key="object" ref="458570708"/>
- <reference key="parent" ref="774585933"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="170538758"/>
<reference key="parent" ref="0"/>
@@ -359,16 +252,6 @@
<reference key="object" ref="359629939"/>
<reference key="parent" ref="774585933"/>
</object>
- <object class="IBObjectRecord">
- <int key="objectID">22</int>
- <reference key="object" ref="49008089"/>
- <reference key="parent" ref="774585933"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">25</int>
- <reference key="object" ref="447558062"/>
- <reference key="parent" ref="774585933"/>
- </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -376,10 +259,7 @@
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="17.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="25.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -411,8 +291,6 @@
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="button">UIButton</string>
- <string key="nameOfTheShow">UILabel</string>
- <string key="nextUp">UILabel</string>
<string key="textField">UITextField</string>
<string key="tweetThis">UIButton</string>
</dictionary>
@@ -421,14 +299,6 @@
<string key="name">button</string>
<string key="candidateClassName">UIButton</string>
</object>
- <object class="IBToOneOutletInfo" key="nameOfTheShow">
- <string key="name">nameOfTheShow</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- <object class="IBToOneOutletInfo" key="nextUp">
- <string key="name">nextUp</string>
- <string key="candidateClassName">UILabel</string>
- </object>
<object class="IBToOneOutletInfo" key="textField">
<string key="name">textField</string>
<string key="candidateClassName">UITextField</string>
@@ -453,10 +323,10 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
- <string key="Tweet.png">{200, 50}</string>
- <string key="UCLMainScreen.png">{320, 460}</string>
- </dictionary>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <string key="NS.key.0">Tweet.png</string>
+ <string key="NS.object.0">{200, 50}</string>
+ </object>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
View
8 UCLRadioViewController.h
@@ -18,6 +18,7 @@
#import <AudioToolbox/AudioToolbox.h>
#import "AppDelegate.h"
+
@class AudioStreamer;
@interface UCLRadioViewController : UIViewController
@@ -27,16 +28,13 @@
AudioStreamer *streamer;
IBOutlet UIButton *tweetThis;
AVAudioSession *audioSession;
- IBOutlet UILabel *nameOfTheShow;
- IBOutlet UILabel *nextUp;
AppDelegate *appDelegate;
- NSArray *allShows;
-
+ NSArray *allShows;
+
}
@property (nonatomic, retain) AppDelegate *appDelegate;
-
- (IBAction)buttonPressed:(id)sender;
- (IBAction)tweetButtonTapped: (id) sender;
@end
View
107 UCLRadioViewController.m
@@ -31,20 +31,12 @@ - (void)viewDidLoad
{
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate getShows];
- nameOfTheShow.text = @"Not Currently Playing";
+
UIImage *image = [UIImage imageNamed:@"playbutton.png"];
[self setButtonImage:image];
// Registers this class as the delegate of the audio session.
[[AVAudioSession sharedInstance] setDelegate: self];
-
- NSError *myErr;
-
- Class twClass = NSClassFromString(@"TWTweetComposeViewController");
- if (!twClass){ // Framework not available, older iOS
- nameOfTheShow.font = [UIFont fontWithName:@"Arial-BoldMT" size:17];
- }
-
-
+ NSError *myErr;
// Initialize the AVAudioSession here.
if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&myErr]) {
// Handle the error here.
@@ -127,97 +119,6 @@ - (IBAction)buttonPressed:(id)sender
}
-- (void) setNameOfTheProgram {
- if (!streamer)
- {
- nameOfTheShow.text = @"Not Currently Playing";
-
- }
-
- else {
-
-
- allShows = [[NSArray alloc]initWithArray:[appDelegate getShows]];
- // Support for TimeZone
- NSDate *now = [NSDate date];
- NSTimeZone *sourceTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
- NSTimeZone *destinationTimeZone = [NSTimeZone systemTimeZone];
- NSInteger destinationGMTOffset = [destinationTimeZone secondsFromGMTForDate:now];
- NSInteger sourceGMTOffset = [sourceTimeZone secondsFromGMTForDate:now];
- NSTimeInterval interval = sourceGMTOffset - destinationGMTOffset ;
- NSDate *today =[[NSDate alloc]initWithTimeInterval:interval sinceDate:now];
-
-
- //Find what today's day of the week is
- NSCalendar *gregorian = [[NSCalendar alloc]
- initWithCalendarIdentifier:NSGregorianCalendar];
- NSDateComponents *weekdayComponents =
- [gregorian components:NSWeekdayCalendarUnit fromDate:today];
- NSInteger weekday = [weekdayComponents weekday];
- NSCalendar *calendar = [NSCalendar currentCalendar];
- //find what time it is
- NSDateComponents *components = [calendar components:NSHourCalendarUnit fromDate:today];
- NSInteger hour = [[[NSCalendar currentCalendar] components:NSHourCalendarUnit fromDate:[gregorian dateFromComponents:components]] hour];
-
- NSInteger nextUpweekday = weekday;
- NSInteger nextUpHour = hour ;
-
- //Let's do this
-
- for (int i=0; i < [allShows count]; i++){
- if ([[[allShows objectAtIndex:i]dayOfTheWeek] integerValue] == weekday) {
-
- if (hour >= [[[allShows objectAtIndex:i] startTime] integerValue] && hour <= [[[allShows objectAtIndex:i] endTime] integerValue]){
- nameOfTheShow.text = [[allShows objectAtIndex:i]name];
- nextUpHour = [[[allShows objectAtIndex:i]endTime]integerValue];
-
-
- if ([[[allShows objectAtIndex:i] endTime] integerValue] == 23){
-
- nextUpHour = 00;
-
- }
-
-
- if ([[[allShows objectAtIndex:i] endTime] integerValue] == 00){
- if (weekday == 7){
- nextUpweekday = 1;
- }
- else {nextUpweekday ++;}
- }
-
-
- for (int j=0; i < [allShows count]; j++){
- if ([[[allShows objectAtIndex:i]dayOfTheWeek] integerValue] == nextUpweekday) {
-
- if (nextUpHour == [[[allShows objectAtIndex:i] startTime] integerValue]){
-
- nextUp.text = [allShows objectAtIndex:j];
-
-
- }
-
-
- }
-
-
- }
-
-
- }
-
- }
-
- }
-
-}
-}
-
-
-
-
-
-
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context
{
@@ -232,8 +133,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
onThread:[NSThread mainThread]
withObject:[UIImage imageNamed:@"stopbutton.png"]
waitUntilDone:NO];
- [audioSession setActive:TRUE error:NULL];
- [self setNameOfTheProgram];
+ [audioSession setActive:TRUE error:NULL];
}
else
{
@@ -248,7 +148,6 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
waitUntilDone:NO];
[audioSession setActive:FALSE error:NULL];
- [self setNameOfTheProgram];
}
[pool release];
View
BIN  arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  loadingbutton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  playbutton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  stopbutton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.