Wednesday, February 29, 2012

UITableView iPhone Programming Tutorial - Part 1

UITableView iPhone Programming Tutorial - Part 1 Tube. Duration : 9.02 Mins.


For MORE lessons like this, visit MyCodeTeacher.com I Build iPhone Apps! Just e-mail me and let me know what you need built! NOTE!!! View this at higher quality here: vimeo.com A tutorial that teaches iPhone programmers how to populate a UITableView. SOURCE CODE: #import "TableViewTestAppDelegate.h" @implementation TableViewTestAppDelegate @synthesize window; - (void)applicationDidFinishLaunching:(UIApplication *)application { contentArray = [[NSArray arrayWithObjects:@"First", @"Second", @"Third", nil] retain]; [window addSubview:[mainNavController view]]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [contentArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identity = @"MainCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identity]; if(cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identity] autorelease]; } cell.text = [contentArray objectAtIndex:indexPath.row]; return cell; } - (void)dealloc { [window release]; [super dealloc]; } @end E-mail me for .zip

Keywords: apple, iphone, programming, dev, development, masna, anthony, mac, macosx, osx, objective-c, objc, objc2.0, cocoa, cocoatouch

No comments:

Post a Comment