Skip to content
Browse files

Just the basic start of the service for the space.labitat.dk webservi…

…ce api
  • Loading branch information...
1 parent 6b660bb commit 91004b1db14532a89edfad50388276a45141654d Kasper Kronborg committed
View
1 .gitignore
@@ -1 +1,2 @@
iBlip.xcodeproj/project.xcworkspace/xcuserdata/*
+iBlip.xcodeproj/xcuserdata/*
View
40 iBlip.xcodeproj/project.pbxproj
@@ -20,6 +20,9 @@
1C55CED41334BC5400770377 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1C55CED21334BC5400770377 /* InfoPlist.strings */; };
1C55CED71334BC5400770377 /* iBlipTests.h in Resources */ = {isa = PBXBuildFile; fileRef = 1C55CED61334BC5400770377 /* iBlipTests.h */; };
1C55CED91334BC5400770377 /* iBlipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C55CED81334BC5400770377 /* iBlipTests.m */; };
+ 1C55CEE61334BEA500770377 /* LABService.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C55CEE51334BEA500770377 /* LABService.m */; };
+ 1C55CEEB1334BF3E00770377 /* LABBlipViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C55CEE91334BF3E00770377 /* LABBlipViewController.m */; };
+ 1C55CEEC1334BF3E00770377 /* LABBlipViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1C55CEEA1334BF3E00770377 /* LABBlipViewController.xib */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -50,6 +53,11 @@
1C55CED51334BC5400770377 /* iBlipTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iBlipTests-Prefix.pch"; sourceTree = "<group>"; };
1C55CED61334BC5400770377 /* iBlipTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iBlipTests.h; sourceTree = "<group>"; };
1C55CED81334BC5400770377 /* iBlipTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = iBlipTests.m; sourceTree = "<group>"; };
+ 1C55CEE41334BEA500770377 /* LABService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LABService.h; path = iBlip/lib/LABService.h; sourceTree = "<group>"; };
+ 1C55CEE51334BEA500770377 /* LABService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LABService.m; path = iBlip/lib/LABService.m; sourceTree = "<group>"; };
+ 1C55CEE81334BF3E00770377 /* LABBlipViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LABBlipViewController.h; path = classes/controllers/LABBlipViewController.h; sourceTree = "<group>"; };
+ 1C55CEE91334BF3E00770377 /* LABBlipViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LABBlipViewController.m; path = classes/controllers/LABBlipViewController.m; sourceTree = "<group>"; };
+ 1C55CEEA1334BF3E00770377 /* LABBlipViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = LABBlipViewController.xib; path = classes/controllers/LABBlipViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -79,6 +87,7 @@
1C55CEA01334BC5400770377 = {
isa = PBXGroup;
children = (
+ 1C55CEE21334BDE700770377 /* Labitat Lib */,
1C55CEB51334BC5400770377 /* iBlip */,
1C55CECF1334BC5400770377 /* iBlipTests */,
1C55CEAE1334BC5400770377 /* Frameworks */,
@@ -108,6 +117,7 @@
1C55CEB51334BC5400770377 /* iBlip */ = {
isa = PBXGroup;
children = (
+ 1C55CEE71334BEFB00770377 /* Controllers */,
1C55CEBE1334BC5400770377 /* iBlipAppDelegate.h */,
1C55CEBF1334BC5400770377 /* iBlipAppDelegate.m */,
1C55CEC11334BC5400770377 /* MainWindow.xib */,
@@ -147,6 +157,33 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ 1C55CEE21334BDE700770377 /* Labitat Lib */ = {
+ isa = PBXGroup;
+ children = (
+ 1C55CEE31334BDFD00770377 /* New Group */,
+ 1C55CEE41334BEA500770377 /* LABService.h */,
+ 1C55CEE51334BEA500770377 /* LABService.m */,
+ );
+ name = "Labitat Lib";
+ sourceTree = "<group>";
+ };
+ 1C55CEE31334BDFD00770377 /* New Group */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = "New Group";
+ sourceTree = "<group>";
+ };
+ 1C55CEE71334BEFB00770377 /* Controllers */ = {
+ isa = PBXGroup;
+ children = (
+ 1C55CEE81334BF3E00770377 /* LABBlipViewController.h */,
+ 1C55CEE91334BF3E00770377 /* LABBlipViewController.m */,
+ 1C55CEEA1334BF3E00770377 /* LABBlipViewController.xib */,
+ );
+ name = Controllers;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -219,6 +256,7 @@
files = (
1C55CEBA1334BC5400770377 /* InfoPlist.strings in Resources */,
1C55CEC31334BC5400770377 /* MainWindow.xib in Resources */,
+ 1C55CEEC1334BF3E00770377 /* LABBlipViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -256,6 +294,8 @@
files = (
1C55CEBD1334BC5400770377 /* main.m in Sources */,
1C55CEC01334BC5400770377 /* iBlipAppDelegate.m in Sources */,
+ 1C55CEE61334BEA500770377 /* LABService.m in Sources */,
+ 1C55CEEB1334BF3E00770377 /* LABBlipViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
17 iBlip/classes/controllers/LABBlipViewController.h
@@ -0,0 +1,17 @@
+//
+// LABBlipViewController.h
+// iBlip
+//
+// Created by Kasper Kronborg on 19/03/11.
+// Copyright 2011 Xstream Media Solutions. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface LABBlipViewController : UIViewController {
+
+ IBOutlet UILabel *blip;
+}
+
+@end
View
66 iBlip/classes/controllers/LABBlipViewController.m
@@ -0,0 +1,66 @@
+//
+// LABBlipViewController.m
+// iBlip
+//
+// Created by Kasper Kronborg on 19/03/11.
+// Copyright 2011 Xstream Media Solutions. All rights reserved.
+//
+
+#import "LABBlipViewController.h"
+#import "LABService.h"
+
+
+@implementation LABBlipViewController
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [blip release];
+ [super dealloc];
+}
+
+- (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
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ LABService *service = [[LABService alloc] init];
+ [service fetchBlip:^(NSString *dataString) {
+ NSLog(@"Data: %@", dataString);
+ [blip setText:dataString];
+ }];
+ // Do any additional setup after loading the view from its nib.
+}
+
+- (void)viewDidUnload
+{
+ [blip release];
+ blip = nil;
+ [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
237 iBlip/classes/controllers/LABBlipViewController.xib
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1056</int>
+ <string key="IBDocument.SystemVersion">10J567</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1305</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">462.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">300</string>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ <string>IBUILabel</string>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <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>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUILabel" id="488654075">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 20}, {42, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="62839085"/>
+ <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">Blip:</string>
+ <object class="NSFont" key="IBUIFont" id="1011224308">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">17</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSColor" key="IBUITextColor" id="49943785">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ <object class="IBUILabel" id="62839085">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{70, 20}, {108, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <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">Please wait ...</string>
+ <reference key="IBUIFont" ref="1011224308"/>
+ <reference key="IBUITextColor" ref="49943785"/>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ </object>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="488654075"/>
+ <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>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <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>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">blip</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="62839085"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="488654075"/>
+ <reference ref="62839085"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </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">5</int>
+ <reference key="object" ref="488654075"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="62839085"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>LABBlipViewController</string>
+ <string>UIResponder</string>
+ <string>{{556, 412}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">LABBlipViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">blip</string>
+ <string key="NS.object.0">UILabel</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">blip</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">blip</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/LABBlipViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">300</string>
+ </data>
+</archive>
View
3 iBlip/iBlipAppDelegate.m
@@ -7,6 +7,7 @@
//
#import "iBlipAppDelegate.h"
+#import "LABBlipViewController.h"
@implementation iBlipAppDelegate
@@ -16,6 +17,8 @@ @implementation iBlipAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
+ LABBlipViewController *blipViewController = [[LABBlipViewController alloc] initWithNibName:@"LABBlipViewController" bundle:nil];
+ [self.window setRootViewController:blipViewController];
[self.window makeKeyAndVisible];
return YES;
}
View
22 iBlip/lib/LABService.h
@@ -0,0 +1,22 @@
+//
+// LABService.h
+// iBlip
+//
+// Created by Kasper Kronborg on 19/03/11.
+// Copyright 2011 Xstream Media Solutions. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface LABService : NSObject {
+ @private
+ NSURLConnection *connection;
+ NSString *dataString;
+
+ void (^_block)();
+}
+
+-(void)fetchBlip:(void(^)())aBlock;
+
+@end
View
27 iBlip/lib/LABService.m
@@ -0,0 +1,27 @@
+//
+// LABService.m
+// iBlip
+//
+// Created by Kasper Kronborg on 19/03/11.
+// Copyright 2011 Xstream Media Solutions. All rights reserved.
+//
+
+#import "LABService.h"
+
+
+@implementation LABService
+
+-(void)fetchBlip:(void(^)())aBlock {
+ _block = [aBlock copy];
+ connection = [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://space.labitat.dk/last"]] delegate:self];
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
+ dataString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
+ _block(dataString);
+}
+
+@end

0 comments on commit 91004b1

Please sign in to comment.
Something went wrong with that request. Please try again.