venues now have correct information on them

This commit is contained in:
Senad Uka
2014-09-05 07:27:19 +02:00
parent 0e1b3048ce
commit 7bea7f47fc
15 changed files with 475 additions and 64 deletions

View File

@@ -13,6 +13,10 @@
3068701319B6301C007E4A0E /* FESScheduleEntryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068701219B6301C007E4A0E /* FESScheduleEntryCell.m */; };
3068701619B6DA8D007E4A0E /* FESScheduleFilmsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068701519B6DA8D007E4A0E /* FESScheduleFilmsViewController.m */; };
3068701919B6F135007E4A0E /* FESScheduleFilmCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068701819B6F135007E4A0E /* FESScheduleFilmCell.m */; };
3068701D19B8723E007E4A0E /* FESVenueEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068701C19B8723E007E4A0E /* FESVenueEntry.m */; };
3068702019B88054007E4A0E /* FESVenueEntryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068701F19B88054007E4A0E /* FESVenueEntryCell.m */; };
3068702319B883C1007E4A0E /* FESVenuesTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068702219B883C1007E4A0E /* FESVenuesTableViewController.m */; };
3068702719B8C03E007E4A0E /* FESDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 3068702619B8C03E007E4A0E /* FESDataProvider.m */; };
3CEA73BD19B1A86D00076FC5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CEA73BC19B1A86C00076FC5 /* Foundation.framework */; };
3CEA73BF19B1A86D00076FC5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CEA73BE19B1A86D00076FC5 /* CoreGraphics.framework */; };
3CEA73C119B1A86D00076FC5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CEA73C019B1A86D00076FC5 /* UIKit.framework */; };
@@ -51,6 +55,14 @@
3068701519B6DA8D007E4A0E /* FESScheduleFilmsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FESScheduleFilmsViewController.m; path = schedule/FESScheduleFilmsViewController.m; sourceTree = "<group>"; };
3068701719B6F135007E4A0E /* FESScheduleFilmCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESScheduleFilmCell.h; path = schedule/FESScheduleFilmCell.h; sourceTree = "<group>"; };
3068701819B6F135007E4A0E /* FESScheduleFilmCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FESScheduleFilmCell.m; path = schedule/FESScheduleFilmCell.m; sourceTree = "<group>"; };
3068701B19B8723E007E4A0E /* FESVenueEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESVenueEntry.h; path = venues/FESVenueEntry.h; sourceTree = "<group>"; };
3068701C19B8723E007E4A0E /* FESVenueEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FESVenueEntry.m; path = venues/FESVenueEntry.m; sourceTree = "<group>"; };
3068701E19B88054007E4A0E /* FESVenueEntryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESVenueEntryCell.h; path = venues/FESVenueEntryCell.h; sourceTree = "<group>"; };
3068701F19B88054007E4A0E /* FESVenueEntryCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FESVenueEntryCell.m; path = venues/FESVenueEntryCell.m; sourceTree = "<group>"; };
3068702119B883C1007E4A0E /* FESVenuesTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESVenuesTableViewController.h; path = venues/FESVenuesTableViewController.h; sourceTree = "<group>"; };
3068702219B883C1007E4A0E /* FESVenuesTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FESVenuesTableViewController.m; path = venues/FESVenuesTableViewController.m; sourceTree = "<group>"; };
3068702519B8C03E007E4A0E /* FESDataProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESDataProvider.h; path = common/FESDataProvider.h; sourceTree = "<group>"; };
3068702619B8C03E007E4A0E /* FESDataProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FESDataProvider.m; path = common/FESDataProvider.m; sourceTree = "<group>"; };
3CEA73B919B1A86C00076FC5 /* FestivalHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FestivalHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
3CEA73BC19B1A86C00076FC5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
3CEA73BE19B1A86D00076FC5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -113,6 +125,28 @@
name = schedule;
sourceTree = "<group>";
};
3068701A19B86EF4007E4A0E /* venues */ = {
isa = PBXGroup;
children = (
3068701B19B8723E007E4A0E /* FESVenueEntry.h */,
3068701C19B8723E007E4A0E /* FESVenueEntry.m */,
3068701E19B88054007E4A0E /* FESVenueEntryCell.h */,
3068701F19B88054007E4A0E /* FESVenueEntryCell.m */,
3068702119B883C1007E4A0E /* FESVenuesTableViewController.h */,
3068702219B883C1007E4A0E /* FESVenuesTableViewController.m */,
);
name = venues;
sourceTree = "<group>";
};
3068702419B8C00E007E4A0E /* common */ = {
isa = PBXGroup;
children = (
3068702519B8C03E007E4A0E /* FESDataProvider.h */,
3068702619B8C03E007E4A0E /* FESDataProvider.m */,
);
name = common;
sourceTree = "<group>";
};
3CEA73B019B1A86C00076FC5 = {
isa = PBXGroup;
children = (
@@ -146,6 +180,8 @@
3CEA73C219B1A86D00076FC5 /* FestivalHelper */ = {
isa = PBXGroup;
children = (
3068702419B8C00E007E4A0E /* common */,
3068701A19B86EF4007E4A0E /* venues */,
3068700419B2D4C7007E4A0E /* schedule */,
3CEA73CB19B1A86D00076FC5 /* FESAppDelegate.h */,
3CEA73CC19B1A86D00076FC5 /* FESAppDelegate.m */,
@@ -284,12 +320,16 @@
buildActionMask = 2147483647;
files = (
3068700D19B5AB16007E4A0E /* FESScheduleTableViewController.m in Sources */,
3068702019B88054007E4A0E /* FESVenueEntryCell.m in Sources */,
3CEA73C919B1A86D00076FC5 /* main.m in Sources */,
3068702719B8C03E007E4A0E /* FESDataProvider.m in Sources */,
3068701319B6301C007E4A0E /* FESScheduleEntryCell.m in Sources */,
3068701919B6F135007E4A0E /* FESScheduleFilmCell.m in Sources */,
3068701D19B8723E007E4A0E /* FESVenueEntry.m in Sources */,
3068700719B2D6B1007E4A0E /* FESSCheduleEntry.m in Sources */,
3CEA73CD19B1A86D00076FC5 /* FESAppDelegate.m in Sources */,
3068701619B6DA8D007E4A0E /* FESScheduleFilmsViewController.m in Sources */,
3068702319B883C1007E4A0E /* FESVenuesTableViewController.m in Sources */,
3068700A19B2F826007E4A0E /* FESScheduleFilm.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FestivalHelper/schedule/FESScheduleTableViewController.m"
timestampString = "431422378.990975"
timestampString = "431586143.879636"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "98"
endingLineNumber = "98"
startingLineNumber = "84"
endingLineNumber = "84"
landmarkName = "-setupScheduleFromJSONArray:"
landmarkType = "5">
</BreakpointContent>
@@ -26,12 +26,12 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FestivalHelper/schedule/FESScheduleTableViewController.m"
timestampString = "431422378.990975"
timestampString = "431586143.879636"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "75"
endingLineNumber = "75"
landmarkName = "-getScheduleDataFromServer"
startingLineNumber = "73"
endingLineNumber = "73"
landmarkName = "-setupScheduleFromJSONArray:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
@@ -42,7 +42,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FestivalHelper/schedule/FESScheduleTableViewController.m"
timestampString = "431422378.990975"
timestampString = "431586143.879636"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "87"
@@ -58,11 +58,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FestivalHelper/schedule/FESScheduleTableViewController.m"
timestampString = "431422378.990975"
timestampString = "431586143.879636"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "101"
endingLineNumber = "101"
startingLineNumber = "85"
endingLineNumber = "85"
landmarkName = "-setupScheduleFromJSONArray:"
landmarkType = "5">
</BreakpointContent>
@@ -74,27 +74,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FestivalHelper/schedule/FESScheduleTableViewController.m"
timestampString = "431422378.990975"
timestampString = "431586143.879636"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "99"
endingLineNumber = "99"
landmarkName = "-setupScheduleFromJSONArray:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FestivalHelper/schedule/FESScheduleTableViewController.m"
timestampString = "431422565.438656"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "170"
endingLineNumber = "170"
startingLineNumber = "156"
endingLineNumber = "156"
landmarkName = "-prepareForSegue:sender:"
landmarkType = "5">
</BreakpointContent>

View File

@@ -89,25 +89,25 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="108"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VMV-Mw-Ifg">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="20:50" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VMV-Mw-Ifg">
<rect key="frame" x="20" y="20" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qhF-PW-R8w">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Neki film" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qhF-PW-R8w">
<rect key="frame" x="70" y="20" width="236" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yQC-zo-ba8">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Neko kino" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yQC-zo-ba8">
<rect key="frame" x="70" y="48" width="236" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5wK-D2-9Nf">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="150'" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5wK-D2-9Nf">
<rect key="frame" x="70" y="77" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
@@ -143,24 +143,56 @@
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2Po-QA-1an" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1894" y="-235"/>
<point key="canvasLocation" x="1895" y="-242"/>
</scene>
<!--Table View Controller - Root View Controller-->
<!--Venues Table View Controller - Venues-->
<scene sceneID="CX5-hP-Yrk">
<objects>
<tableViewController id="OwN-NY-lQV" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="fiy-kO-qOW">
<tableViewController id="OwN-NY-lQV" customClass="FESVenuesTableViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="88" sectionHeaderHeight="22" sectionFooterHeight="22" id="fiy-kO-qOW">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="pRA-XH-MNZ">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="venueEntryCell" rowHeight="88" id="pRA-XH-MNZ" customClass="FESVenueEntryCell">
<rect key="frame" x="0.0" y="86" width="320" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="pRA-XH-MNZ" id="8Lb-ac-tEa">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="87"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Summer Theatre HT Eronet" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r39-y9-TCo">
<rect key="frame" x="20" y="20" width="280" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Gimnazijska bb" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LMT-fD-pgR">
<rect key="frame" x="20" y="49" width="217" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="3.000" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P0F-Kj-f6N">
<rect key="frame" x="257" y="49" width="43" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="P0F-Kj-f6N" firstAttribute="leading" secondItem="LMT-fD-pgR" secondAttribute="trailing" constant="20" id="259-5g-8ST"/>
<constraint firstItem="LMT-fD-pgR" firstAttribute="leading" secondItem="8Lb-ac-tEa" secondAttribute="leading" constant="20" id="Auk-fz-VIf"/>
<constraint firstAttribute="trailing" secondItem="r39-y9-TCo" secondAttribute="trailing" constant="20" id="NPk-Wf-nvl"/>
<constraint firstAttribute="trailing" secondItem="P0F-Kj-f6N" secondAttribute="trailing" constant="20" id="Zux-mN-h5D"/>
<constraint firstItem="r39-y9-TCo" firstAttribute="leading" secondItem="8Lb-ac-tEa" secondAttribute="leading" constant="20" id="t43-fZ-5TG"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="venueAddress" destination="LMT-fD-pgR" id="dwO-ag-hWh"/>
<outlet property="venueCapacity" destination="P0F-Kj-f6N" id="aZT-si-Jyv"/>
<outlet property="venueName" destination="r39-y9-TCo" id="1GJ-KA-bxa"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
@@ -168,7 +200,7 @@
<outlet property="delegate" destination="OwN-NY-lQV" id="StC-gP-bLn"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Root View Controller" id="aOU-AZ-Itd"/>
<navigationItem key="navigationItem" title="Venues" id="aOU-AZ-Itd"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3Sp-V5-4ky" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>

View File

@@ -16,7 +16,9 @@
#endif
#if(URL_LOCAL==1)
#define SCHEDULE_URL @"http://127.0.0.1:8080/sff2014/schedule.json"
#define SCHEDULE_URL @"http://127.0.0.1:8080/sff2014/schedule.json?local"
#define VENUES_URL @"http://127.0.0.1:8080/sff2014/venues.json?local"
#else
#define SCHEDULE_URL @"http://localhost:8080/sff2014/schedule.json"
#define SCHEDULE_URL @"http://localhost:8080/sff2014/schedule.json?remote"
#define VENUES_URL @"http://localhost:8080/sff2014/venues.json?remote"
#endif

View File

@@ -0,0 +1,15 @@
//
// FESDataProvider.h
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FESDataProvider : NSObject
+(void)getDataFromServerForUrl:(NSString *)urlString andProcessThemWith:(void (^)(NSData *data))block;
@end

View File

@@ -0,0 +1,27 @@
//
// FESDataProvider.m
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import "FESDataProvider.h"
@implementation FESDataProvider
+(void)getDataFromServerForUrl:(NSString *)urlString andProcessThemWith:(void (^)(NSData *data))block {
NSLog(@"Getting data from: %@" , urlString);
NSURL *url = [[NSURL alloc] initWithString:urlString];
[NSURLConnection sendAsynchronousRequest:[[NSURLRequest alloc] initWithURL:url] queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if(connectionError) {
NSLog(@"Error getting %@ data from url: - %@", urlString, [connectionError localizedDescription]);
}
else {
NSLog(@"Parsing data.");
block(data);
}
}];
}
@end

View File

@@ -36,6 +36,7 @@
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)didReceiveMemoryWarning

View File

@@ -10,6 +10,7 @@
#import "FESSCheduleEntry.h"
#import "FESScheduleEntryCell.h"
#import "FESScheduleFilmsViewController.h"
#import "FESDataProvider.h"
@interface FESScheduleTableViewController ()
@@ -34,7 +35,10 @@
[super viewDidLoad];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self getScheduleDataFromServer];
[FESDataProvider getDataFromServerForUrl:SCHEDULE_URL andProcessThemWith:^(NSData *data) {
[self setupScheduleFromJSONArray:data];
[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
}];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
@@ -62,25 +66,7 @@
return [self.scheduleArray count];
}
-(void)getScheduleDataFromServer {
NSLog(@"Getting data");
NSURL *url = [[NSURL alloc] initWithString:SCHEDULE_URL];
[NSURLConnection sendAsynchronousRequest:[[NSURLRequest alloc] initWithURL:url] queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if(connectionError) {
NSLog(@"Error getting %@ schedule data: - %@", SCHEDULE_URL, [connectionError localizedDescription]);
}
else {
NSLog(@"Parsing data.");
[self setupScheduleFromJSONArray:data];
[self.tableView reloadData];
}
}];
}
-(void)setupScheduleFromJSONArray:(NSData*)dataFromServerArray{

View File

@@ -0,0 +1,21 @@
//
// FESVenueEntry.h
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FESVenueEntry : NSObject
-(id)initWithJSONData:(NSDictionary*)data;
@property (assign) NSInteger venueEntryId;
@property (strong) NSString *venueName;
@property (strong) NSString *venueAddress;
@property (strong) NSString *venueCapacity;
@end

View File

@@ -0,0 +1,32 @@
//
// FESVenueEntry.m
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import "FESVenueEntry.h"
@implementation FESVenueEntry
@synthesize venueEntryId;
@synthesize venueName;
@synthesize venueAddress;
@synthesize venueCapacity;
-(id)initWithJSONData:(NSDictionary*)data{
self = [super init];
if(self){
//NSLog(@"initWithJSONData method called");
self.venueEntryId = [[data objectForKey:@"id"] integerValue];
self.venueName = [data objectForKey:@"name"];
self.venueAddress = [data objectForKey:@"address"];
self.venueCapacity = [data objectForKey:@"capacity"];
}
return self;
}
@end

View File

@@ -0,0 +1,18 @@
//
// FESVenueEntryCell.h
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FESVenueEntryCell : UITableViewCell
@property (weak, nonatomic)IBOutlet UILabel *venueName;
@property (weak, nonatomic)IBOutlet UILabel *venueAddress;
@property (weak, nonatomic)IBOutlet UILabel *venueCapacity;
@end

View File

@@ -0,0 +1,38 @@
//
// FESVenueEntryCell.m
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import "FESVenueEntryCell.h"
@implementation FESVenueEntryCell
@synthesize venueCapacity;
@synthesize venueAddress;
@synthesize venueName;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)awakeFromNib
{
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

View File

@@ -0,0 +1,15 @@
//
// FESVenuesTableViewController.h
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FESVenuesTableViewController : UITableViewController
@property (strong)NSMutableArray *venuesArray;
@end

View File

@@ -0,0 +1,155 @@
//
// FESVenuesTableViewController.m
// FestivalHelper
//
// Created by Hamo Hapic on 04/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import "FESVenuesTableViewController.h"
#import "FESVenueEntry.h"
#import "FESDataProvider.h"
#import "FESVenueEntryCell.h"
@interface FESVenuesTableViewController ()
@end
@implementation FESVenuesTableViewController
@synthesize venuesArray;
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
[FESDataProvider getDataFromServerForUrl:VENUES_URL andProcessThemWith:^(NSData *data) {
[self setupScheduleFromJSONArray:data];
[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
}];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [venuesArray count];
}
-(void)setupScheduleFromJSONArray:(NSData*)dataFromServerArray{
NSError *error;
self.venuesArray = [[NSMutableArray alloc] init];
NSArray *arrayFromServer = [NSJSONSerialization JSONObjectWithData:dataFromServerArray options:0 error:&error];
if(error){
NSLog(@"error parsing the json data from server with error description - %@", [error localizedDescription]);
}
else {
self.venuesArray = [[NSMutableArray alloc] init];
for(NSDictionary *venueData in arrayFromServer)
{
FESVenueEntry *entry = [[FESVenueEntry alloc] initWithJSONData:venueData];
[self.venuesArray addObject:entry];
}
NSLog(@"success!");
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *retrievedCell = [tableView dequeueReusableCellWithIdentifier:@"venueEntryCell" forIndexPath:indexPath];
FESVenueEntryCell *cell = (FESVenueEntryCell *)retrievedCell;
FESVenueEntry *venueEntry = [venuesArray objectAtIndex:indexPath.row];
cell.venueName.text = venueEntry.venueName;
cell.venueAddress.text = venueEntry.venueAddress;
cell.venueCapacity.text = venueEntry.venueCapacity;
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -0,0 +1,45 @@
[
{
"id": "1",
"name": "Summer Theatre HT Eronet",
"address": "Gimnazijska bb",
"capacity": "3.000"
},
{
"id": "2",
"name": "Summer Theatre HT Eronet",
"address": "Gimnazijska bb",
"capacity": "3.000"
},
{
"id": "3",
"name": "Meeting point",
"address": "Kresevljakovica 13",
"capacity": "190"
},
{
"id": "4",
"name": "National Theatre",
"address": "Obala Kulina Bana 9",
"capacity": "400"
},
{
"id": "5",
"name": "Novi Grad Cinema",
"address": "Bulevar Mese Selimovica 97",
"capacity": "300"
},
{
"id": "6",
"name": "Multiplex Cinema City",
"address": "Marsala Tita 26",
"capacity": "700"
},
{
"id": "7",
"name": "Lasko Summer Nights",
"address": "Hamdije Kresevljakovica 24",
"capacity": "280"
},
]