Skip to content

Instantly share code, notes, and snippets.

@jverkoey
Created November 6, 2010 02:33
Show Gist options
  • Save jverkoey/665140 to your computer and use it in GitHub Desktop.
Save jverkoey/665140 to your computer and use it in GitHub Desktop.
Test case for 151.
diff --git a/samples/TTCatalog/Classes/TableControlsTestController.m b/samples/TTCatalog/Classes/TableControlsTestController.m
index 19b7380..08501fd 100644
--- a/samples/TTCatalog/Classes/TableControlsTestController.m
+++ b/samples/TTCatalog/Classes/TableControlsTestController.m
@@ -13,41 +13,45 @@
self.autoresizesForKeyboard = YES;
self.variableHeightRows = YES;
- UITextField* textField = [[[UITextField alloc] init] autorelease];
- textField.placeholder = @"UITextField";
- textField.font = TTSTYLEVAR(font);
-
- UITextField* textField2 = [[[UITextField alloc] init] autorelease];
- textField2.font = TTSTYLEVAR(font);
- textField2.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
- TTTableControlItem* textFieldItem = [TTTableControlItem itemWithCaption:@"TTTableControlItem"
- control:textField2];
-
- UITextView* textView = [[[UITextView alloc] init] autorelease];
- textView.text = @"UITextView";
- textView.font = TTSTYLEVAR(font);
-
- TTTextEditor* editor = [[[TTTextEditor alloc] init] autorelease];
- editor.font = TTSTYLEVAR(font);
- editor.backgroundColor = TTSTYLEVAR(backgroundColor);
- editor.autoresizesToText = NO;
- editor.minNumberOfLines = 3;
- editor.placeholder = @"TTTextEditor";
-
- UISwitch* switchy = [[[UISwitch alloc] init] autorelease];
- TTTableControlItem* switchItem = [TTTableControlItem itemWithCaption:@"UISwitch" control:switchy];
-
- UISlider* slider = [[[UISlider alloc] init] autorelease];
- TTTableControlItem* sliderItem = [TTTableControlItem itemWithCaption:@"UISlider" control:slider];
-
- self.dataSource = [TTListDataSource dataSourceWithObjects:
- textField,
- editor,
- textView,
- textFieldItem,
- switchItem,
- sliderItem,
- nil];
+ NSMutableArray* objects = [NSMutableArray array];
+ for (int ix = 0; ix < 10; ++ix) {
+ UITextField* textField = [[[UITextField alloc] init] autorelease];
+ textField.placeholder = @"UITextField";
+ textField.font = TTSTYLEVAR(font);
+
+ UITextField* textField2 = [[[UITextField alloc] init] autorelease];
+ textField2.font = TTSTYLEVAR(font);
+ textField2.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+ TTTableControlItem* textFieldItem = [TTTableControlItem itemWithCaption:@"TTTableControlItem"
+ control:textField2];
+
+ UITextView* textView = [[[UITextView alloc] init] autorelease];
+ textView.text = @"UITextView";
+ textView.font = TTSTYLEVAR(font);
+
+ TTTextEditor* editor = [[[TTTextEditor alloc] init] autorelease];
+ editor.font = TTSTYLEVAR(font);
+ editor.backgroundColor = TTSTYLEVAR(backgroundColor);
+ editor.autoresizesToText = NO;
+ editor.minNumberOfLines = 3;
+ editor.placeholder = @"TTTextEditor";
+
+ UISwitch* switchy = [[[UISwitch alloc] init] autorelease];
+ TTTableControlItem* switchItem = [TTTableControlItem itemWithCaption:@"UISwitch" control:switchy];
+
+ UISlider* slider = [[[UISlider alloc] init] autorelease];
+ TTTableControlItem* sliderItem = [TTTableControlItem itemWithCaption:@"UISlider" control:slider];
+
+ [objects addObjectsFromArray:[NSArray arrayWithObjects:
+ textField,
+ editor,
+ textView,
+ textFieldItem,
+ switchItem,
+ sliderItem,
+ nil]];
+ }
+ self.dataSource = [TTListDataSource dataSourceWithItems:objects];
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment