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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-22-2011, 05:11 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 23
rashdan is on a distinguished road
Default loop through controls in tableview

Hi !
I'm using textfields in my tableview, it's kind of a form. I need to retrieve a textfield's value out of the tableview. Please , tell me how can I do that. This is what I've come so far with...

Code:
for (id object in [self.view subviews]) {
    if ([object isKindOfClass:[UITableView class]]) {
        // now what should I do here to get the controls within the tableview ???
    }
}
Please, help.
rashdan is offline   Reply With Quote
Old 06-22-2011, 06:17 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

you are using a wrong approach......that doesn't consider the MVC.

You UITableView is the View, you need a Model where you store these value, like a NSMutableArray....so the idea is to save data in that array...
__________________
dany_dev is offline   Reply With Quote
Old 06-22-2011, 06:24 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 23
rashdan is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
you are using a wrong approach......that doesn't consider the MVC.

You UITableView is the View, you need a Model where you store these value, like a NSMutableArray....so the idea is to save data in that array...
Thanks, is it possible if I can get text from a specific textfield , I have tags set for all the textfield, how can I get data for textfield having tag 10 ???
rashdan is offline   Reply With Quote
Old 06-22-2011, 06:36 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

assuming that you have a NSMutableArray of the lenght of the number of cells, you will look the object at index: 10
__________________
dany_dev is offline   Reply With Quote
Old 06-22-2011, 06:42 AM   #5 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 23
rashdan is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
assuming that you have a NSMutableArray of the lenght of the number of cells, you will look the object at index: 10
Ok here's what the problem is, I type in text in the textfield, and have the code to get the text from textfield, both in textFieldDidEndEditing and textFieldShouldReturn.
I type in the text and without pressing the Done button on the keyboard, I press the right navigation button , now on this button's action I want to get the textfield's text.
Please, tell me how do I do that ???
rashdan is offline   Reply With Quote
Reply

Bookmarks

Tags
tableview, textfield, xcode

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
» Online Users: 326
8 members and 318 guests
chemistry, Dnnake, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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