Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

UITableView iPhone Programming Tutorial - Part 1

Loading...

Sign in or sign up now!
118,808
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 15, 2008

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: http://vimeo.com/1014998

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

  • likes, 17 dislikes

Link to this comment:

Share to:

Uploader Comments (Masna360)

  • question can you program apps in Python and port them over to the iphone or does the os on it already run Python?

  • I don't believe you can. I know that you can use C++ scripts for Audio Programming (but Apple has setup the iPhone programming environment for that). I don't know about Python. I would suggest just learning Objective-C, it's a wonderful language.

  • LOL! Care to elaborate?

  • @yoman258 2 year old comment but you still have to ask wtf?

  • @RITSKIS Indeed.

Top Comments

  • I stuttered for 2 seconds. I don't rehearse this, I just wing it. I apologize that not even I, Masna360 from YouTube, am not perfect.

  • nope

    its your wallpaper

see all

All Comments (63)

Sign In or Sign Up now to post a comment!
  • @Masna360

    It is and old comment but still for clarification - Objective-C was not in fact developed by Apple, it was used by Apple, but the language itself comes for Smalltalk, and in the begining had nothing to do with Apple.

  • You just earned a like, favorite and subscriber!

  • make apps without programming snappii.com

  • this is good for someone that know how to programm but for beginner sno good

  • @Colton328 Android is the OS, which provides a framework that runs on Dalvik VMs. Java is the programming language that most developers use because of the provided Google-developed Java libraries. However, you could use other languages too, if you know what you're doing. Still, you have to learn about how the Android OS operates in order to efficiently program for it.

    Also, C# is not pointless. It's a powerful language taking aspects of many languages, including C/++, Java, and even Pascal.

  • @HardCoreProgrammer1

    Theres no such thing as "Android", its Java.

    Btw, C# is pointless. Its managed, only works on windows and will die in some time. Learn C or a similar language.

    Remember, you need a mac to code iPhone apps. All languages are similar in some terms, so learning Objective C may help you when learning java, and vice-versa.

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more