Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 09-22-2010, 05:43 AM   #7 (permalink)
kgupta
Registered Member
 
Join Date: Sep 2010
Location: India
Posts: 26
kgupta is on a distinguished road
Default

Can we display a UITextField in side a UILabel and this UILabel is a cell in UITableView.



Quote:
Originally Posted by funnylookinhat View Post
Yes, there are a couple of ways you can do this.

The easiest way is to create UITableViewCells with Interface Builder, and put text fields in them. Link both the cell and the text field to whatever controller manages the datasource/delegate for the UITableView.

So for example, let's say you create the following:
Code:
IBOutlet UITableViewCell *cell1;
UITextField *text1;
IBOutlet UITableViewCell *cell2;
UITextField *text2;
IBOutlet UITableViewCell *cell3;
UITextField *text3;
In your cellForRowAtIndexPath function you would do the following:
Code:
if([indexPath row] == 0) {
    return cell1;
} else if([indexPath row] == 1) {
    return cell2;
} else {
    return cell3;
}
Then you can just reference the text fields as normal - connect them with interface builder, etc.

Does that help?
kgupta is offline   Reply With Quote
 

» Advertisements
» Online Users: 399
15 members and 384 guests
Chickenrig, chits12345, daniljan, dansparrow, darrenshain, ephefei, EvilElf, hrushikeshaddon, ipodphone, jimmyon122, JmayLive, linkmx, Mnadeep, SamorodovAlex, tomtom100
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,588
Threads: 94,083
Posts: 402,775
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daniljan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:33 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.