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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-02-2009, 10:23 AM   #1 (permalink)
jbe
Registered Member
 
Join Date: Aug 2009
Posts: 2
Default UITextField inside UITableView

Hi,
I insert in my tableview the textfields i have created and it works. But when i click the "Done" button, nothing happens. It can't reach the textFieldShouldReturn function so it can't reach [textField resignFirstResponder].
An idea?
jbe is offline   Reply With Quote
Old 09-02-2009, 10:34 AM   #2 (permalink)
jbe
Registered Member
 
Join Date: Aug 2009
Posts: 2
Default

Quote:
Originally Posted by jbe View Post
Hi,
I insert in my tableview the textfields i have created and it works. But when i click the "Done" button, nothing happens. It can't reach the textFieldShouldReturn function so it can't reach [textField resignFirstResponder].
An idea?
Ok, my problem was the delegate! I solve it on myself
jbe is offline   Reply With Quote
Old 09-10-2009, 02:11 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 9
Default

JBE - How are you able to put UITextFields into your UITableView?? I'm trying to do it and can't figure it out...
funnylookinhat is offline   Reply With Quote
Old 04-05-2010, 04:59 AM   #4 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 8
Default

JBE - How are you able to put UITextFields into your UITableView?? I'm trying to do it and can't figure it out... please reply

zeeshan khan
zeeshan is offline   Reply With Quote
Old 04-05-2010, 05:00 AM   #5 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 8
Default

funnylookinhat - Did you get success in putting UITextField into your UITableView. Please let me know if you done it.
Thanks in advance
zeeshan is offline   Reply With Quote
Old 04-05-2010, 09:05 AM   #6 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 9
Default

Quote:
Originally Posted by zeeshan View Post
funnylookinhat - Did you get success in putting UITextField into your UITableView. Please let me know if you done it.
Thanks in advance
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?
funnylookinhat is offline   Reply With Quote
Old 09-22-2010, 06:43 AM   #7 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: India
Posts: 26
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
Old 09-22-2010, 09:13 AM   #8 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 9
Default

Quote:
Originally Posted by kgupta View Post
Can we display a UITextField in side a UILabel and this UILabel is a cell in UITableView.
No - You can't. The reason is that a UILabel does not possess a view property - so you can't make a UITextVield (View) the view within a UILabel.

What exactly are you trying to do? Having a UITextField inside a UILabel inside a UITableView seems quite roundabout.
funnylookinhat is offline   Reply With Quote
Old 09-23-2010, 05:08 AM   #9 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: India
Posts: 26
Default

I want to display 7 UITextFiels in UITableView cell in one line. How can it be done.

Thanks.


Quote:
Originally Posted by funnylookinhat View Post
No - You can't. The reason is that a UILabel does not possess a view property - so you can't make a UITextVield (View) the view within a UILabel.

What exactly are you trying to do? Having a UITextField inside a UILabel inside a UITableView seems quite roundabout.

Last edited by kgupta; 09-23-2010 at 08:03 AM.
kgupta is offline   Reply With Quote
Reply

Bookmarks

Tags
uitableview, uitableviewcell, uitextfield

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,884
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, karlam963
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:15 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0