diff --git a/AddressFormatter.m b/AddressFormatter.m index ad82b01..c0a8086 100644 --- a/AddressFormatter.m +++ b/AddressFormatter.m @@ -12,7 +12,7 @@ @implementation AddressFormatter + (NSString *)createAddressUsingHostname:(NSString *)hostname portNumber:(NSString *)portNumber suffix:(NSString *)suffix; { - return [NSString stringWithFormat:@"%@:%@/api/json/",hostname,portNumber]; + return [NSString stringWithFormat:@"%@:%@/%@/api/json/",hostname,portNumber, suffix ? suffix : @""]; } @end diff --git a/BuildDetailView.h b/BuildDetailView.h new file mode 100644 index 0000000..c970e12 --- /dev/null +++ b/BuildDetailView.h @@ -0,0 +1,17 @@ +// +// Created by mike_rowe on 27/10/11. +// +// To change the template use AppCode | Preferences | File Templates. +// + + +#import +#import + +#import "build.h" + +@interface BuildDetailView : UIView + +@property (nonatomic, retain) Build *build; + +@end \ No newline at end of file diff --git a/BuildDetailView.m b/BuildDetailView.m new file mode 100644 index 0000000..30d94ab --- /dev/null +++ b/BuildDetailView.m @@ -0,0 +1,48 @@ +// +// Created by mike_rowe on 27/10/11. +// +// To change the template use AppCode | Preferences | File Templates. +// + + +#import +#import +#import "BuildDetailView.h" + +@implementation BuildDetailView + +@synthesize build; + +- (id)initWithFrame:(CGRect)frame; +{ + self = [super initWithFrame:frame]; + + if (self) { + [self setBackgroundColor:[UIColor whiteColor]]; + } + + return self; +} + + +#pragma mark - UIView Lifecycle + +- (void)layoutSubviews; +{ +} + +- (void)drawRect:(CGRect)rect; +{ + CGRect frame = CGRectMake(0., 10., CGRectGetMaxX(rect), 40.); + UILabel *build_name = [[UILabel alloc] initWithFrame:frame]; + [build_name setTextAlignment:UITextAlignmentCenter]; + [build_name setFont:[UIFont boldSystemFontOfSize:22.]]; + [build_name setText:[build name]]; + [self addSubview:build_name]; +} + +- (void)refresh; +{ +} + +@end \ No newline at end of file diff --git a/DisplayBuildsView.m b/DisplayBuildsView.m index 793fbb5..943a4cc 100644 --- a/DisplayBuildsView.m +++ b/DisplayBuildsView.m @@ -6,9 +6,12 @@ // Copyright (c) 2011 __MyCompanyName__. All rights reserved. // +#import +#import #import "DisplayBuildsView.h" #import "UIColor+Hex.h" #import "Build.h" +#import "BuildDetailView.h" @interface DisplayBuildsView () @@ -62,7 +65,9 @@ - (void)refresh; #pragma mark - UITableViewDelegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; { - + BuildDetailView *detailView = [[BuildDetailView alloc] initWithFrame:[self frame]]; + [detailView setBuild:[[self buildData] objectAtIndex:[indexPath row]]]; + [self addSubview:detailView]; } - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath; @@ -90,7 +95,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } Build *build = [[self buildData] objectAtIndex:[indexPath row]]; - [[cell textLabel] setText:[build name]]; if ([[build status] isEqualToString:@"red"]) diff --git a/iBroke.xcodeproj/project.pbxproj b/iBroke.xcodeproj/project.pbxproj index 45cb76b..fdc5462 100644 --- a/iBroke.xcodeproj/project.pbxproj +++ b/iBroke.xcodeproj/project.pbxproj @@ -54,6 +54,7 @@ 21F76C30144E838E00F0BB5F /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F76C26144E838E00F0BB5F /* ASIInputStream.m */; settings = {COMPILER_FLAGS = " -fno-objc-arc"; }; }; 21F76C31144E838E00F0BB5F /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F76C28144E838E00F0BB5F /* ASINetworkQueue.m */; settings = {COMPILER_FLAGS = " -fno-objc-arc"; }; }; 21F76C34144E839C00F0BB5F /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F76C33144E839C00F0BB5F /* Reachability.m */; settings = {COMPILER_FLAGS = " -fno-objc-arc"; }; }; + 21F76C34144E839C00F0BB61 /* BuildDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F76C34144E839C00F0BB60 /* BuildDetailView.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -143,6 +144,8 @@ 21F76C29144E838E00F0BB5F /* ASIProgressDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIProgressDelegate.h; path = "Third Party/asi-http-request/Classes/ASIProgressDelegate.h"; sourceTree = ""; }; 21F76C32144E839C00F0BB5F /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Reachability.h; path = "Third Party/asi-http-request/External/Reachability/Reachability.h"; sourceTree = ""; }; 21F76C33144E839C00F0BB5F /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Reachability.m; path = "Third Party/asi-http-request/External/Reachability/Reachability.m"; sourceTree = ""; }; + 21F76C34144E839C00F0BB60 /* BuildDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildDetailView.m; sourceTree = ""; }; + 21F76C34144E839C00F0BB62 /* BuildDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuildDetailView.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -250,6 +253,8 @@ 2152CC32144E68DC00F22682 /* Views */ = { isa = PBXGroup; children = ( + 21F76C34144E839C00F0BB62 /* BuildDetailView.h */, + 21F76C34144E839C00F0BB60 /* BuildDetailView.m */, 2152CC33144E690D00F22682 /* SettingsView.h */, 2152CC34144E690D00F22682 /* SettingsView.m */, 219E3B2B144EADB100EF4A5D /* DisplayBuildsView.h */, @@ -452,6 +457,7 @@ 218A041B144F8B8C0015AD0D /* Build.m in Sources */, 218A0429144F956F0015AD0D /* NSArray+Blocks.m in Sources */, 2172413D1459152200DE5E82 /* UIColor+Hex.m in Sources */, + 21F76C34144E839C00F0BB61 /* BuildDetailView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };