Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Addresses a few memory leaks in the example app. Also, changed the "b…

…uild" folder in gitignore to catch all build folders. (Wasn't working for example proj using Tower).
  • Loading branch information...
commit 137bf4865d6b6df259750f1cb57e774f427a8702 1 parent 6acbe74
@grgcombs grgcombs authored
View
4 .gitignore
@@ -1,5 +1,5 @@
# Xcode
-build/*
+build
*.pbxuser
!default.pbxuser
*.mode1v3
@@ -15,4 +15,4 @@ profile
*.moved-aside
# osx noise
-.DS_Store
+.DS_Store
View
22 Example/StackedViewKitExample/ExampleStackRootController.m
@@ -54,17 +54,20 @@ - (void)viewDidLoad {
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];
// prepare menu content
- NSMutableArray *cellContents = [[[NSMutableArray alloc] init] autorelease];
- [cellContents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"08-chat"], kCellImage, NSLocalizedString(@"Example1",@""), kCellText, nil]];
- [cellContents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"11-clock"], kCellImage, NSLocalizedString(@"Example2",@""), kCellText, nil]];
- [cellContents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"15-tags"], kCellImage, NSLocalizedString(@" ",@""), kCellText, nil]];
- [cellContents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"08-chat"], kCellImage, NSLocalizedString(@"<- Collapse",@""), kCellText, nil]];
- [cellContents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"11-clock"], kCellImage, NSLocalizedString(@"Expand ->",@""), kCellText, nil]];
- [cellContents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"15-tags"], kCellImage, NSLocalizedString(@"Clear All",@""), kCellText, nil]];
- self.cellContents = [[cellContents copy] autorelease];
+ NSMutableArray *contents = [[NSMutableArray alloc] init];
+ [contents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"08-chat"], kCellImage, NSLocalizedString(@"Example1",@""), kCellText, nil]];
+ [contents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"11-clock"], kCellImage, NSLocalizedString(@"Example2",@""), kCellText, nil]];
+ [contents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"15-tags"], kCellImage, NSLocalizedString(@" ",@""), kCellText, nil]];
+ [contents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"08-chat"], kCellImage, NSLocalizedString(@"<- Collapse",@""), kCellText, nil]];
+ [contents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"11-clock"], kCellImage, NSLocalizedString(@"Expand ->",@""), kCellText, nil]];
+ [contents addObject:[NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"15-tags"], kCellImage, NSLocalizedString(@"Clear All",@""), kCellText, nil]];
+ self.cellContents = contents;
+ [contents release];
// add table menu
- self.menuTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kMenuWidth, self.view.height) style:UITableViewStylePlain];
+ UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kMenuWidth, self.view.height) style:UITableViewStylePlain];
+ self.menuTable = tableView;
+ [tableView release];
self.menuTable.backgroundColor = [UIColor clearColor];
self.menuTable.delegate = self;
@@ -146,6 +149,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if (viewController) {
[XAppDelegate.stackController pushViewController:viewController animated:YES];
+ [viewController release];
}
}
View
1  Example/StackedViewKitExample/ExampleViewController2.m
@@ -63,6 +63,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
[XAppDelegate.stackController pushViewController:viewController animated:YES];
+ [viewController release];
@steipete Owner

Thanks, great!

Just one thing - i'm using 4 spaces here. This is a per-project setting for Xcode4, but Xcode3 doesn't yet know about that. Just that we keep the same style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
- (void)setIndexNumber:(NSUInteger)anIndexNumber {
View
1  Example/StackedViewKitExample/MenuTableViewCell.m
@@ -41,6 +41,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
glowView.image = [UIImage imageNamed:@"glow"];
glowView.hidden = YES;
[self addSubview:glowView];
+ [glowView release];
}
return self;
}

1 comment on commit 137bf48

@grgcombs

Ack! I'll change my rig immediately.

Also, sorry for being so quiet as of late. I'm writing a huge exam for my students tomorrow and I think it is important to make them feel as though they did not study enough ;-)

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