Migrate sample project to ARC

Conflicts:

	ExampleProject/Example.xcodeproj/project.pbxproj
This commit is contained in:
Justin Spahr-Summers
2011-11-12 17:47:47 -08:00
parent 068ec9c502
commit 9ff48ddd31
8 changed files with 7 additions and 43 deletions
@@ -20,12 +20,6 @@
@implementation ExampleAppDelegate
- (void)dealloc
{
[tableViewWindow release];
[scrollViewWindow release];
[super dealloc];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
@@ -40,11 +34,9 @@
/* TUINSView is the bridge between the standard AppKit NSView-based heirarchy and the TUIView-based heirarchy */
TUINSView *tuiTableViewContainer = [[TUINSView alloc] initWithFrame:b];
[tableViewWindow setContentView:tuiTableViewContainer];
[tuiTableViewContainer release];
ExampleView *tableExample = [[ExampleView alloc] initWithFrame:b];
tuiTableViewContainer.rootView = tableExample;
[tableExample release];
/** Scroll View */
scrollViewWindow = [[NSWindow alloc] initWithContentRect:b styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask backing:NSBackingStoreBuffered defer:YES];
@@ -55,11 +47,9 @@
/* TUINSView is the bridge between the standard AppKit NSView-based heirarchy and the TUIView-based heirarchy */
TUINSView *tuiScrollViewContainer = [[TUINSView alloc] initWithFrame:b];
[scrollViewWindow setContentView:tuiScrollViewContainer];
[tuiScrollViewContainer release];
ExampleScrollView *scrollExample = [[ExampleScrollView alloc] initWithFrame:b];
tuiScrollViewContainer.rootView = scrollExample;
[scrollExample release];
[self showTableViewExampleWindow:nil];
@@ -31,16 +31,10 @@
TUIImageView *imageView = [[TUIImageView alloc] initWithImage:[TUIImage imageNamed:@"large-image.jpeg"]];
[_scrollView addSubview:imageView];
[_scrollView setContentSize:imageView.frame.size];
[imageView release];
}
return self;
}
- (void)dealloc
{
[_scrollView release];
[super dealloc];
}
@end
@@ -7,10 +7,6 @@
/**
* Clean up
*/
-(void)dealloc {
[_labelRenderer release];
[super dealloc];
}
/**
* Initialize
@@ -60,7 +56,6 @@
gradient = [[NSGradient alloc] initWithStartingColor:start endingColor:end];
[gradient drawInRect:self.bounds angle:90];
[gradient release];
[[start shadowWithLevel:0.1] set];
NSRectFill(NSMakeRect(0, 0, self.bounds.size.width, 1));
@@ -29,13 +29,13 @@
@interface ExampleTabBar : TUIView
{
id<ExampleTabBarDelegate> delegate;
id<ExampleTabBarDelegate> __unsafe_unretained delegate;
NSArray *tabViews;
}
- (id)initWithNumberOfTabs:(NSInteger)nTabs;
@property (nonatomic, assign) id<ExampleTabBarDelegate> delegate;
@property (nonatomic, unsafe_unretained) id<ExampleTabBarDelegate> delegate;
@property (nonatomic, readonly) NSArray *tabViews;
@end
@@ -67,7 +67,6 @@
};
[self addSubview:t];
[_tabViews addObject:t];
[t release];
}
tabViews = [[NSArray alloc] initWithArray:_tabViews];
@@ -75,11 +74,6 @@
return self;
}
- (void)dealloc
{
[tabViews release];
[super dealloc];
}
- (void)drawRect:(CGRect)rect
{
@@ -38,11 +38,6 @@
return self;
}
- (void)dealloc
{
[textRenderer release];
[super dealloc];
}
- (NSAttributedString *)attributedString
{
+3 -9
View File
@@ -28,8 +28,8 @@
self.backgroundColor = [TUIColor colorWithWhite:0.9 alpha:1.0];
// if you're using a font a lot, it's best to allocate it once and re-use it
exampleFont1 = [[TUIFont fontWithName:@"HelveticaNeue" size:15] retain];
exampleFont2 = [[TUIFont fontWithName:@"HelveticaNeue-Bold" size:15] retain];
exampleFont1 = [TUIFont fontWithName:@"HelveticaNeue" size:15];
exampleFont2 = [TUIFont fontWithName:@"HelveticaNeue-Bold" size:15];
CGRect b = self.bounds;
b.origin.y += TAB_HEIGHT;
@@ -106,12 +106,6 @@
return self;
}
- (void)dealloc
{
[_tableView release];
[_tabBar release];
[super dealloc];
}
- (void)tabBar:(ExampleTabBar *)tabBar didSelectTab:(NSInteger)index
{
@@ -144,7 +138,7 @@
title.color = [TUIColor blackColor];
title.font = exampleFont2;
view.labelRenderer.attributedString = title;
return [view autorelease];
return view;
}
- (TUITableViewCell *)tableView:(TUITableView *)tableView cellForRowAtIndexPath:(TUIFastIndexPath *)indexPath