diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4e689a --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.DS_Store +*.swp +*~.nib + +build/* + +*.pbxuser +*.perspective +*.perspectivev3 +*.mode1v3 +*.mode2v3 + diff --git a/Classes/CustomCellBackgroundView.h b/Classes/CustomCellBackgroundView.h new file mode 100644 index 0000000..3543fab --- /dev/null +++ b/Classes/CustomCellBackgroundView.h @@ -0,0 +1,27 @@ +// +// CustomCellBackgroundView.h +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright 2009 Coriolis Technologies. All rights reserved. +// + +#import + + +typedef enum { + CustomCellBackgroundViewPositionTop, + CustomCellBackgroundViewPositionMiddle, + CustomCellBackgroundViewPositionBottom, + CustomCellBackgroundViewPositionSingle +} CustomCellBackgroundViewPosition; + +@interface CustomCellBackgroundView : UIView { + UIColor *borderColor; + UIColor *fillColor; + CustomCellBackgroundViewPosition position; +} + +@property(nonatomic, retain) UIColor *borderColor, *fillColor; +@property(nonatomic) CustomCellBackgroundViewPosition position; +@end diff --git a/Classes/CustomCellBackgroundView.m b/Classes/CustomCellBackgroundView.m new file mode 100644 index 0000000..453abdc --- /dev/null +++ b/Classes/CustomCellBackgroundView.m @@ -0,0 +1,115 @@ +// +// CustomCellBackgroundView.m +// +// Created by Mike Akers on 11/21/08. +// Copyright 2008 __MyCompanyName__. All rights reserved. +// + +#import "CustomCellBackgroundView.h" + +static void addRoundedRectToPath(CGContextRef context, CGRect rect, + float ovalWidth,float ovalHeight); + +@implementation CustomCellBackgroundView +@synthesize borderColor, fillColor, position; + +- (BOOL) isOpaque { + return NO; +} + +- (id)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + // Initialization code + } + return self; +} + +- (void)drawRect:(CGRect)rect { + // Drawing code + CGContextRef c = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(c, [fillColor CGColor]); + CGContextSetStrokeColorWithColor(c, [borderColor CGColor]); + + if (position == CustomCellBackgroundViewPositionTop) { + CGContextFillRect(c, CGRectMake(0.0f, rect.size.height - 10.0f, rect.size.width, 10.0f)); + CGContextBeginPath(c); + CGContextMoveToPoint(c, 0.0f, rect.size.height - 10.0f); + CGContextAddLineToPoint(c, 0.0f, rect.size.height); + CGContextAddLineToPoint(c, rect.size.width, rect.size.height); + CGContextAddLineToPoint(c, rect.size.width, rect.size.height - 10.0f); + CGContextStrokePath(c); + CGContextClipToRect(c, CGRectMake(0.0f, 0.0f, rect.size.width, rect.size.height - 10.0f)); + } else if (position == CustomCellBackgroundViewPositionBottom) { + CGContextFillRect(c, CGRectMake(0.0f, 0.0f, rect.size.width, 10.0f)); + CGContextBeginPath(c); + CGContextMoveToPoint(c, 0.0f, 10.0f); + CGContextAddLineToPoint(c, 0.0f, 0.0f); + CGContextStrokePath(c); + CGContextBeginPath(c); + CGContextMoveToPoint(c, rect.size.width, 0.0f); + CGContextAddLineToPoint(c, rect.size.width, 10.0f); + CGContextStrokePath(c); + CGContextClipToRect(c, CGRectMake(0.0f, 10.0f, rect.size.width, rect.size.height)); + } else if (position == CustomCellBackgroundViewPositionMiddle) { + CGContextFillRect(c, rect); + CGContextBeginPath(c); + CGContextMoveToPoint(c, 0.0f, 0.0f); + CGContextAddLineToPoint(c, 0.0f, rect.size.height); + CGContextAddLineToPoint(c, rect.size.width, rect.size.height); + CGContextAddLineToPoint(c, rect.size.width, 0.0f); + CGContextStrokePath(c); + return; // no need to bother drawing rounded corners, so we return + } + + // At this point the clip rect is set to only draw the appropriate + // corners, so we fill and stroke a rounded rect taking the entire rect + + CGContextBeginPath(c); + addRoundedRectToPath(c, rect, 10.0f, 10.0f); + CGContextFillPath(c); + + CGContextSetLineWidth(c, 1); + CGContextBeginPath(c); + addRoundedRectToPath(c, rect, 10.0f, 10.0f); + CGContextStrokePath(c); +} + + +- (void)dealloc { + [borderColor release]; + [fillColor release]; + [super dealloc]; +} + + +@end + +static void addRoundedRectToPath(CGContextRef context, CGRect rect, + float ovalWidth,float ovalHeight) + +{ + float fw, fh; + + if (ovalWidth == 0 || ovalHeight == 0) {// 1 + CGContextAddRect(context, rect); + return; + } + + CGContextSaveGState(context);// 2 + + CGContextSetShouldAntialias(context, YES); + CGContextTranslateCTM (context, CGRectGetMinX(rect),// 3 + CGRectGetMinY(rect)); + CGContextScaleCTM (context, ovalWidth, ovalHeight);// 4 + fw = CGRectGetWidth (rect) / ovalWidth;// 5 + fh = CGRectGetHeight (rect) / ovalHeight;// 6 + + CGContextMoveToPoint(context, fw, fh/2); // 7 + CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);// 8 + CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1);// 9 + CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1);// 10 + CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); // 11 + CGContextClosePath(context);// 12 + + CGContextRestoreGState(context);// 13 +} diff --git a/Classes/CustomCellView.h b/Classes/CustomCellView.h new file mode 100644 index 0000000..28f7ff5 --- /dev/null +++ b/Classes/CustomCellView.h @@ -0,0 +1,20 @@ +// +// CustomCellView.h +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright 2009 Coriolis Technologies. All rights reserved. +// + +#import + + +@interface CustomCellView : UITableViewCell { + + IBOutlet UILabel *textLabel; + +} + +@property (nonatomic, retain) UILabel *textLabel; + +@end diff --git a/Classes/CustomCellView.m b/Classes/CustomCellView.m new file mode 100644 index 0000000..16e70bb --- /dev/null +++ b/Classes/CustomCellView.m @@ -0,0 +1,38 @@ +// +// CustomCellView.m +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright 2009 Coriolis Technologies. All rights reserved. +// + +#import "CustomCellView.h" + + +@implementation CustomCellView + +@synthesize textLabel; + +- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier +{ + if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) { + // Initialization code + } + return self; +} + + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + // Configure the view for the selected state +} + + +- (void)dealloc +{ + [textLabel release]; + [super dealloc]; +} + +@end diff --git a/Classes/TableTestAppDelegate.h b/Classes/TableTestAppDelegate.h new file mode 100644 index 0000000..e61d454 --- /dev/null +++ b/Classes/TableTestAppDelegate.h @@ -0,0 +1,22 @@ +// +// TableTestAppDelegate.h +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright Coriolis Technologies 2009. All rights reserved. +// + +#import + +@class TableTestViewController; + +@interface TableTestAppDelegate : NSObject { + UIWindow *window; + TableTestViewController *viewController; +} + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet TableTestViewController *viewController; + +@end + diff --git a/Classes/TableTestAppDelegate.m b/Classes/TableTestAppDelegate.m new file mode 100644 index 0000000..63119bd --- /dev/null +++ b/Classes/TableTestAppDelegate.m @@ -0,0 +1,33 @@ +// +// TableTestAppDelegate.m +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright Coriolis Technologies 2009. All rights reserved. +// + +#import "TableTestAppDelegate.h" +#import "TableTestViewController.h" + +@implementation TableTestAppDelegate + +@synthesize window; +@synthesize viewController; + + +- (void)applicationDidFinishLaunching:(UIApplication *)application { + + // Override point for customization after app launch + [window addSubview:viewController.view]; + [window makeKeyAndVisible]; +} + + +- (void)dealloc { + [viewController release]; + [window release]; + [super dealloc]; +} + + +@end diff --git a/Classes/TableTestViewController.h b/Classes/TableTestViewController.h new file mode 100644 index 0000000..07f619f --- /dev/null +++ b/Classes/TableTestViewController.h @@ -0,0 +1,22 @@ +// +// TableTestViewController.h +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright Coriolis Technologies 2009. All rights reserved. +// + +#import + +@interface TableTestViewController : UIViewController { + + IBOutlet UITableView *tableView; + NSArray *cellList; + +} + +@property (nonatomic, retain) UITableView *tableView; +@property (nonatomic, retain) NSArray *cellList; + +@end + diff --git a/Classes/TableTestViewController.m b/Classes/TableTestViewController.m new file mode 100644 index 0000000..af1043c --- /dev/null +++ b/Classes/TableTestViewController.m @@ -0,0 +1,133 @@ +// +// TableTestViewController.m +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright Coriolis Technologies 2009. All rights reserved. +// + +#import "TableTestViewController.h" +#import "CustomCellBackgroundView.h" +#import "CustomCellView.h" + +@implementation TableTestViewController + +@synthesize tableView; +@synthesize cellList; + + +//========================================================================================== +- (void)viewDidLoad +{ + self.cellList = [NSArray arrayWithObjects: + [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys:@"Red", @"text", + [UIColor redColor], @"color", nil], + [NSDictionary dictionaryWithObjectsAndKeys:@"Green", @"text", + [UIColor greenColor], @"color", nil], + [NSDictionary dictionaryWithObjectsAndKeys:@"Cyan", @"text", + [UIColor cyanColor], @"color", nil], + nil], + [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys:@"Red", @"text", + [UIColor redColor], @"color", nil], + [NSDictionary dictionaryWithObjectsAndKeys:@"Cyan", @"text", + [UIColor cyanColor], @"color", nil], + nil], + [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys:@"Cyan", @"text", + [UIColor cyanColor], @"color", nil], + nil], + [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys:@"White", @"text", + [UIColor whiteColor], @"color", nil], + nil], + nil]; + + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview + // Release anything that's not essential, such as cached data +} + +- (void)dealloc +{ + [super dealloc]; +} + +//========================================================================================== +#pragma mark UITableView delegate methods +//========================================================================================== +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return [cellList count]; +} + +//========================================================================================== +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + int count; + + count = [[cellList objectAtIndex:section] count]; + + return count; +} + +//========================================================================================== +- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"CustomCellView"; + + CustomCellView *cell = (CustomCellView *)[_tableView dequeueReusableCellWithIdentifier:@"CustomCellView"]; + if (cell == nil) { + UIViewController* c = [[UIViewController alloc] initWithNibName:CellIdentifier bundle:nil]; + cell = (CustomCellView *)c.view; + } + + CustomCellBackgroundViewPosition pos; + + pos = CustomCellBackgroundViewPositionBottom; + + NSArray *cellListForSection = [cellList objectAtIndex:indexPath.section]; + + if (indexPath.row == 0) { + pos = CustomCellBackgroundViewPositionTop; + } else { + if (indexPath.row < [cellListForSection count]-1) { + pos = CustomCellBackgroundViewPositionMiddle; + } + } + + if ([cellListForSection count] == 1) { + pos = CustomCellBackgroundViewPositionSingle; + } + + CustomCellBackgroundView *bkgView = [[CustomCellBackgroundView alloc] initWithFrame:cell.frame]; + bkgView.fillColor = [[cellListForSection objectAtIndex:indexPath.row] objectForKey:@"color"]; + bkgView.borderColor = [UIColor blackColor]; + bkgView.position = pos; + cell.backgroundView = bkgView; + cell.backgroundColor = [UIColor redColor]; + cell.textColor = [UIColor redColor]; + cell.textLabel.text = [[cellListForSection objectAtIndex:indexPath.row] objectForKey:@"text"]; + return cell; +} + +//========================================================================================== +- (void)tableView:(UITableView *)_tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + +} + +//========================================================================================== +// Provide section titles +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return [NSString stringWithFormat:@"Section %d", section]; +} + +@end diff --git a/CustomCellView.xib b/CustomCellView.xib new file mode 100644 index 0000000..52ce665 --- /dev/null +++ b/CustomCellView.xib @@ -0,0 +1,214 @@ + + + + 528 + 9G55 + 677 + 949.43 + 353.00 + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + + + IBFirstResponder + + + + 292 + + YES + + + 256 + + YES + + + 292 + {{20, 10}, {241, 21}} + + NO + YES + NO + Label + + Helvetica-Bold + 1.700000e+01 + 16 + + + 1 + MCAwIDAAA + + + 1 + 1.000000e+01 + + + {277, 44} + + + 3 + MCAwAA + + NO + YES + 4 + YES + + + {300, 44} + + + 3 + MSAwAA + + NO + NO + 1 + + CustomCellView + + + + + YES + + + textLabel + + + + 6 + + + + view + + + + 7 + + + + + YES + + 0 + + YES + + + + + + -1 + + + RmlsZSdzIE93bmVyA + + + -2 + + + + + 3 + + + YES + + + + + + 4 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 3.CustomClassName + 3.IBEditorWindowLastContentRect + 3.IBPluginDependency + 4.IBPluginDependency + + + YES + UITableViewController + UIResponder + CustomCellView + {{676, 725}, {300, 44}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 7 + + + + YES + + CustomCellView + UITableViewCell + + textLabel + UILabel + + + IBProjectSource + Classes/CustomCellView.h + + + + + 0 + TableTest.xcodeproj + 3 + + diff --git a/Info.plist b/Info.plist new file mode 100644 index 0000000..fdf8340 --- /dev/null +++ b/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + + diff --git a/MainWindow.xib b/MainWindow.xib new file mode 100644 index 0000000..b2a6230 --- /dev/null +++ b/MainWindow.xib @@ -0,0 +1,206 @@ + + + + 528 + 9E17 + 672 + 949.33 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + IBFilesOwner + + + IBFirstResponder + + + + TableTestViewController + + + + + 292 + {320, 480} + + 1 + MSAxIDEAA + + NO + NO + + + + + + YES + + + delegate + + + + 4 + + + + viewController + + + + 11 + + + + window + + + + 14 + + + + + YES + + 0 + + YES + + + + + + -1 + + + RmlsZSdzIE93bmVyA + + + 3 + + + TableTest App Delegate + + + -2 + + + + + 10 + + + + + 12 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 10.CustomClassName + 10.IBEditorWindowLastContentRect + 10.IBPluginDependency + 12.IBEditorWindowLastContentRect + 12.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + + + YES + UIApplication + UIResponder + TableTestViewController + {{512, 351}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{525, 346}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + TableTestAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 14 + + + + YES + + TableTestAppDelegate + NSObject + + YES + + YES + viewController + window + + + YES + TableTestViewController + UIWindow + + + + IBProjectSource + Classes/TableTestAppDelegate.h + + + + TableTestAppDelegate + NSObject + + IBUserSource + + + + + TableTestViewController + UIViewController + + IBProjectSource + Classes/TableTestViewController.h + + + + + 0 + TableTest.xcodeproj + 3 + + diff --git a/README b/README new file mode 100644 index 0000000..3a103d3 --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +Implements a solution found on http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view + +How to change the background color of a table view cell in a grouped table. + diff --git a/TableTest.xcodeproj/project.pbxproj b/TableTest.xcodeproj/project.pbxproj new file mode 100755 index 0000000..a4e2294 --- /dev/null +++ b/TableTest.xcodeproj/project.pbxproj @@ -0,0 +1,266 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* TableTestAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* TableTestAppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 2899E5220DE3E06400AC0155 /* TableTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* TableTestViewController.xib */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 28D7ACF80DDB3853001CB0EB /* TableTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* TableTestViewController.m */; }; + D4A70D450F51E837002EDFB5 /* CustomCellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D4A70D440F51E837002EDFB5 /* CustomCellBackgroundView.m */; }; + D4A70D860F51EBAA002EDFB5 /* CustomCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = D4A70D850F51EBAA002EDFB5 /* CustomCellView.m */; }; + D4A70D880F51EBC2002EDFB5 /* CustomCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D4A70D870F51EBC2002EDFB5 /* CustomCellView.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623240D0F684500981E51 /* TableTestAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableTestAppDelegate.h; sourceTree = ""; }; + 1D3623250D0F684500981E51 /* TableTestAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableTestAppDelegate.m; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* TableTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TableTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 2899E5210DE3E06400AC0155 /* TableTestViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TableTestViewController.xib; sourceTree = ""; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* TableTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableTestViewController.h; sourceTree = ""; }; + 28D7ACF70DDB3853001CB0EB /* TableTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableTestViewController.m; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* TableTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableTest_Prefix.pch; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D4A70D430F51E837002EDFB5 /* CustomCellBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomCellBackgroundView.h; sourceTree = ""; }; + D4A70D440F51E837002EDFB5 /* CustomCellBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomCellBackgroundView.m; sourceTree = ""; }; + D4A70D840F51EBAA002EDFB5 /* CustomCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomCellView.h; sourceTree = ""; }; + D4A70D850F51EBAA002EDFB5 /* CustomCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomCellView.m; sourceTree = ""; }; + D4A70D870F51EBC2002EDFB5 /* CustomCellView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CustomCellView.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 1D3623240D0F684500981E51 /* TableTestAppDelegate.h */, + 1D3623250D0F684500981E51 /* TableTestAppDelegate.m */, + 28D7ACF60DDB3853001CB0EB /* TableTestViewController.h */, + 28D7ACF70DDB3853001CB0EB /* TableTestViewController.m */, + D4A70D430F51E837002EDFB5 /* CustomCellBackgroundView.h */, + D4A70D440F51E837002EDFB5 /* CustomCellBackgroundView.m */, + D4A70D840F51EBAA002EDFB5 /* CustomCellView.h */, + D4A70D850F51EBAA002EDFB5 /* CustomCellView.m */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* TableTest.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* TableTest_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 2899E5210DE3E06400AC0155 /* TableTestViewController.xib */, + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* Info.plist */, + D4A70D870F51EBC2002EDFB5 /* CustomCellView.xib */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* TableTest */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TableTest" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TableTest; + productName = TableTest; + productReference = 1D6058910D05DD3D006BFB54 /* TableTest.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TableTest" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* TableTest */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 2899E5220DE3E06400AC0155 /* TableTestViewController.xib in Resources */, + D4A70D880F51EBC2002EDFB5 /* CustomCellView.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* TableTestAppDelegate.m in Sources */, + 28D7ACF80DDB3853001CB0EB /* TableTestViewController.m in Sources */, + D4A70D450F51E837002EDFB5 /* CustomCellBackgroundView.m in Sources */, + D4A70D860F51EBAA002EDFB5 /* CustomCellView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = TableTest_Prefix.pch; + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = TableTest; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = TableTest_Prefix.pch; + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = TableTest; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = iphoneos2.2.1; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = iphoneos2.2.1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TableTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TableTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/TableTestViewController.xib b/TableTestViewController.xib new file mode 100644 index 0000000..2ad16e2 --- /dev/null +++ b/TableTestViewController.xib @@ -0,0 +1,205 @@ + + + + 528 + 9G55 + 677 + 949.43 + 353.00 + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + + + IBFirstResponder + + + + 274 + + YES + + + 274 + {320, 460} + + YES + NO + NO + 1 + 1 + 0 + YES + 4.400000e+01 + 1.000000e+01 + 1.000000e+01 + + + {320, 460} + + + 3 + MC43NQA + + 2 + + + NO + + + + + + YES + + + view + + + + 7 + + + + tableView + + + + 9 + + + + delegate + + + + 10 + + + + dataSource + + + + 11 + + + + + YES + + 0 + + YES + + + + + + -1 + + + RmlsZSdzIE93bmVyA + + + -2 + + + + + 6 + + + YES + + + + + + 8 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 6.IBEditorWindowLastContentRect + 6.IBPluginDependency + 8.IBPluginDependency + + + YES + TableTestViewController + UIResponder + {{438, 347}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 12 + + + + YES + + TableTestViewController + UIViewController + + tableView + UITableView + + + IBProjectSource + Classes/TableTestViewController.h + + + + + 0 + TableTest.xcodeproj + 3 + + diff --git a/TableTest_Prefix.pch b/TableTest_Prefix.pch new file mode 100644 index 0000000..4d4cb57 --- /dev/null +++ b/TableTest_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'TableTest' target in the 'TableTest' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/main.m b/main.m new file mode 100644 index 0000000..a35c4a5 --- /dev/null +++ b/main.m @@ -0,0 +1,17 @@ +// +// main.m +// TableTest +// +// Created by Stephan on 22.02.09. +// Copyright Coriolis Technologies 2009. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; +}