uitableview iphone Programming Tutorial – Part 1


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

25 thoughts on “uitableview iphone Programming Tutorial – Part 1”

  1. with so many crappy iPhone learning sites out there, developers are having a hard time finding the right training resource and program. EDUmobile. ORG has changed that with their iPhone Training Program that is currently teaching over 100 students.

  2. Cool video, I just got my Mac set up and started iPhone programming. One question, how did you change the color of the Finderbar? Is it a skinning program?

  3. Great vid 🙂 I’ve got my iPhone too, for free:)
    From here: freebies(.)comoj(.)com/iphone
    So, good luck!!!

  4. Hey Masna360,
    Good job. I appreciate this video as it is a visual aid in my quest to master Obj-C.

    Thanks & keep it coming!!!

  5. 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.

  6. Seriously… what the heck happened at 7:30??? Brain freeze? You don’t um.. ah.. have to.. ah.. so um.. wha what we’re gonna do here?

  7. 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.

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

  9. Question: in the app delegate code file you create the contentArray as with the retain keyword:

    contentArray = [[NSArray arrayWithObjects:@”First”, … , nil] retain];”).

    Shouldn’t you subsequently release the contentArray object in the dealloc method?

    [contentArray dealloc];

Leave a Reply to jakemertz Cancel reply

Your email address will not be published. Required fields are marked *