From 68cb1b7bbf3494d40d2afd46c8373cc2be10f4a3 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 2 Aug 2011 00:45:13 -0400 Subject: [PATCH 1/4] floor this stuff to prevent sub pixel frames --- Classes/PullRefreshTableViewController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/PullRefreshTableViewController.m b/Classes/PullRefreshTableViewController.m index b373376..03998b6 100644 --- a/Classes/PullRefreshTableViewController.m +++ b/Classes/PullRefreshTableViewController.m @@ -62,12 +62,12 @@ - (void)addPullToRefreshHeader { refreshLabel.textAlignment = UITextAlignmentCenter; refreshArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]]; - refreshArrow.frame = CGRectMake((REFRESH_HEADER_HEIGHT - 27) / 2, - (REFRESH_HEADER_HEIGHT - 44) / 2, + 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((REFRESH_HEADER_HEIGHT - 20) / 2, (REFRESH_HEADER_HEIGHT - 20) / 2, 20, 20); + refreshSpinner.frame = CGRectMake(floorf(floorf(REFRESH_HEADER_HEIGHT - 20) / 2), floorf((REFRESH_HEADER_HEIGHT - 20) / 2), 20, 20); refreshSpinner.hidesWhenStopped = YES; [refreshHeaderView addSubview:refreshLabel]; From bbe8d4257b6d56b0dccc2ccc970ed3cbffb5f492 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 2 Aug 2011 00:46:12 -0400 Subject: [PATCH 2/4] modern ignores for xcode 4 --- .gitignore | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6edbbeb..edc082c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,15 @@ -# xcode +# Xcode build/* *.pbxuser +!default.pbxuser *.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 *.perspectivev3 -# osx -.DS_Store +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata profile +*.moved-aside From d5a7feb749ad33ec086855992845936b50c28564 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 2 Aug 2011 00:53:15 -0400 Subject: [PATCH 3/4] assign strings on any type of init Strings were previously only being created on a normal initWithStyle, now it works when you create the controller with a nib, or its its getting unarchived from a nib --- Classes/PullRefreshTableViewController.h | 1 + Classes/PullRefreshTableViewController.m | 38 ++++++++++++++++++------ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Classes/PullRefreshTableViewController.h b/Classes/PullRefreshTableViewController.h index 00450a2..92429f3 100644 --- a/Classes/PullRefreshTableViewController.h +++ b/Classes/PullRefreshTableViewController.h @@ -50,6 +50,7 @@ @property (nonatomic, copy) NSString *textRelease; @property (nonatomic, copy) NSString *textLoading; +- (void)setupStrings; - (void)addPullToRefreshHeader; - (void)startLoading; - (void)stopLoading; diff --git a/Classes/PullRefreshTableViewController.m b/Classes/PullRefreshTableViewController.m index 03998b6..85de5b9 100644 --- a/Classes/PullRefreshTableViewController.m +++ b/Classes/PullRefreshTableViewController.m @@ -38,18 +38,38 @@ @implementation PullRefreshTableViewController @synthesize textPull, textRelease, textLoading, refreshHeaderView, refreshLabel, refreshArrow, refreshSpinner; - (id)initWithStyle:(UITableViewStyle)style { - self = [super initWithStyle:style]; - if (self != nil) { - textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."]; - textRelease = [[NSString alloc] initWithString:@"Release to refresh..."]; - textLoading = [[NSString alloc] initWithString:@"Loading..."]; - } - return self; + self = [super initWithStyle:style]; + if (self != nil) { + [self setupStrings]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self != nil) { + [self setupStrings]; + } + return self; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self != nil) { + [self setupStrings]; + } + return self; } - (void)viewDidLoad { - [super viewDidLoad]; - [self addPullToRefreshHeader]; + [super viewDidLoad]; + [self addPullToRefreshHeader]; +} + +- (void)setupStrings{ + textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."]; + textRelease = [[NSString alloc] initWithString:@"Release to refresh..."]; + textLoading = [[NSString alloc] initWithString:@"Loading..."]; } - (void)addPullToRefreshHeader { From 51323608f31d51ce609b324a943298dc1119223d Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Fri, 21 Oct 2011 01:25:35 -0400 Subject: [PATCH 4/4] Remove whitespace [Gun.io WhitespaceBot] --- Classes/DemoTableViewController.m | 2 +- main.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/DemoTableViewController.m b/Classes/DemoTableViewController.m index 2522d67..bf9f1f9 100644 --- a/Classes/DemoTableViewController.m +++ b/Classes/DemoTableViewController.m @@ -27,7 +27,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - + static NSString *CellIdentifier = @"CellIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { diff --git a/main.m b/main.m index 788b3cd..76d791e 100644 --- a/main.m +++ b/main.m @@ -9,7 +9,7 @@ #import int main(int argc, char *argv[]) { - + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, @"PullToRefreshAppDelegate"); [pool release];