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”
Leave a Reply to oliverkiss2008 Cancel reply
You must be logged in to post a comment.
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.
nevermind i found the translucent menu setting…
My wallpaper is blue but my finderbar is still silver, how can it be changed?
nope
its your wallpaper
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?
What a dock…what’s your screen resolution?
wow. trim dock!
I freaking love you man!
Great vid 🙂 I’ve got my iPhone too, for free:)
From here: freebies(.)comoj(.)com/iphone
So, good luck!!!
LOL
What is the code I would use to add a weblink?
Hey Masna, nice job.
where is your email. I’d like to contact you…
where’s your tutorials bitch?
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!!!
I cannot open a cocoa touch application.
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.
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?
LOL! Care to elaborate?
Objective-C is a horrible language… Only apple fan boys like it apparently.
google PyObjC
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.
question can you program apps in Python and port them over to the iphone or does the os on it already run Python?
lol @ 40$/half hour
Err, I meant, “[contentArray release];”.
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];