Complete table view controller with XML

Hello, I'm from Brazil and am new to ios.
Today I am making an example where I use a table view controller and fill it witharray (NSMutableArray).
However I would do the same using XML so that now, I'm having so many difficulties to the point of not knowing where to start.
The code I use to populate this array was.
It is possible to use something like XML?
#pragma mark - View lifecycle
- (void)viewDidLoad
    [super viewDidLoad];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    registros = [NSMutableArray arrayWithObjects:@"1", @"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14", nil];
- (void)viewDidUnload
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
- (void)viewWillAppear:(BOOL)animated
    [super viewWillAppear:animated];
- (void)viewDidAppear:(BOOL)animated
    [super viewDidAppear:animated];
- (void)viewWillDisappear:(BOOL)animated
    [super viewWillDisappear:animated];
- (void)viewDidDisappear:(BOOL)animated
    [super viewDidDisappear:animated];
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    // Return the number of sections.
    return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    // Return the number of rows in the section.
    return [registros count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    static NSString *CellIdentifier = @"listax";//este é o identificador da celula
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    cell.textLabel.text = [registros objectAtIndex:indexPath.row];
    return cell;

If you have a custom XML schema (not a plist), consider two approaches.
1. Before showing your table view, use NSXMLParserto deserialize the XML document into an NSMutableArray that will be the table view data source.  Typically the array contains custom class instances; one or more class properties are used to set table cell properties in cellForRowAtIndexPath.  If you have never worked with NSXMLParser (or any other SAX parser) before, start by creating a sample app so you understand how that works.
2. Use a 3rd-party DOM parser like GDataXML.  Load your XML document into a class property in your table view's viewDidLoad.  Then the XML document will be the table view data source since elements and attributes can be directly queried using XPath in cellForRowAtIndexPath.  If you have never worked with XML DOM and XPath before, start by creating a sample app so you understand how that works.
If your have a lengthy complex XML document, option #1 might be more efficient because indexed array access is faster than XPath queries.  Theoretically that is why Apple's Cocoa provides DOM support on OS X but not iOS.  There are strategies to improve efficiency if necessary, including your own indexing scheme.  The best solution depends on many factors.  For example, if your XML document includes thousands of rows, but users rarely scroll past the first 10, option #1 would waste time parsing everything.
Both of these approaches keep all data in memory, which is fast but not friendly.  Perfectly fine for reasonably sized data sets.

Similar Messages

  • Storyboard doesn't contain a view controller with identifier 'myViewController'

    I have 3 view controllers on storyboard. One of them has Storyboard Id as 'myViewController'. its runs perfectly on simulator. But when I try to run it on my device it gives following error:
    'Storyboard (<UIStoryboard: 0x1cd626d0>) doesn't contain a view controller with identifier 'myViewController''
    Please help me out with this.

    I'm not sure how "new" you are to Xcode and IB, but just double checking -- did you create the XIB file from Xcode (so that it was added to your project?). Or, if not, did you save it to your project directory somewhere and were prompted to add it to your project? If you created it new from IB it may not be part of your project yet. That's when I have seen my classes missing from the drop down menu on the Identity Inspector.
    One final thing -- after setting File's Owner, I don't see from your code how you are actually loading the NIB file (xib file). You are calling plain "init" in your app delegate where you create these view Controllers. You need to call the "initWithNibName" method. It is the designated init method for view controllers that load their interface from a NIB file.
    Cheers,
    George
    Message was edited by: gkstuart

  • Real Model View Controller with JTextField

    Hi!
    I am new to Java (so please bear with me). I am building a swing application. I already have added a JTable with a corresponding table model that extends AbstractTableModel. Rather than store the data in the table model, I have modified setValueAt and getValueAt to write and read cell data to another location. So far, everything is fine. When doing setValueAt, I have a fireTableCellUpdated statement that I use to update the edited cell. So far, things are all still fine.
    I would like to do the same thing with a JTextField. I found an example in Core Java Volume 1 for create a class that extends PlainDocument. It uses insertString to update the document in a way that ensures that only numbers are entered. I implemented this. Everything is still fine. I changed insertString to update my remote repository (a field in another class). Everything is still fine. Next, I tried to change (override) both getText methods to read from the repository. This works, but is not reflected on the screen.
    I realize that I need the equivalent of a fireTableCellUpdated statement for the class that extends PlainDocument, but do not know how to do this.
    I have looked a lot over the internet for the model view controller implementation. I know that it can be done using event and event listeners, but this seems to defeat the purpose of the model view controller - it seems like you ought to be able to directly modify the model object to access external data.
    My code is below.
    Thanks/Phil Troy
    * PlainDocument class to make it possible to:
    * - Make sure input in unsigned integer
    * - Automatically save data to appropriate locate
    * This will hopefully eventually work by overriding the insertString and getText methods
    * and creating methods that can be overridden to get and save the numerical value
    class UnsignedIntegerDocument extends PlainDocument
         TutorSchedulerPlusSettings settings;
         JTextField textField;
         public UnsignedIntegerDocument(TutorSchedulerPlusSettings settings)
         {     super();
              this.settings = settings;
         public void setTextField(JTextField textField)
         {     this.textField = textField;
         // Overridden method
         public void insertString(int offs, String str, AttributeSet a) throws BadLocationException
         {     if (str == null) return;
              String oldString = getText(0, getLength());
              String newString = oldString.substring(0, offs) + str +oldString.substring(offs);
              try
              {     setValue(Integer.parseInt(newString));
                   super.insertString(offs, str, a);
                   fireInsertUpdate(new DefaultDocumentEvent(offs, 10, DocumentEvent.EventType.INSERT));
              catch(NumberFormatException e)
         public String getText()
         {     return String.valueOf(getValue());
         public String getText(int offset, int length) throws BadLocationException
         {     String s = String.valueOf(getValue());
              if (length > 0)
                   s = s.substring(offset, length);
              return s;
         public void getText(int offset, int length, Segment txt) throws BadLocationException
         {     //super.getText(offset, length, txt);
              char[] c = new char[10];
              String s = String.valueOf(getValue());
              s.getChars(offset, length, c, 0);
              txt = new Segment(c, 0, length);
         public String getValue()
         {     int i = settings.maxStudents;
              String s = String.valueOf(i);
              return s;          
         void setValue(int i)
         {     settings.maxStudents = i;
    }

    Hi!
    Thanks for your response. Unfortunately, based on your response, I guess that I must not have clearly communicated what I am trying to do.
    I am using both JTables and JTextFields, and would like to use them both in the same way.
    When using JTable, I extend an AbstractTableModel so that it refers to another data source (in a separate class), rather than one inside of the AbstractTableModel. Thus the getValueAt method, getColumnCount method, setValueAt method, . .. all call methods in another class. The details of that other class are irrelevant, but they could be accessing data from a database (via JDBC) or from other machines via some other communication mechanism.
    I would like to do exactly the same thing with a JTextField. I wish for the data to come from a class other than an object of type PlainDocument, or of any class that implements the Document interface. Instead, I would like to use a class that implements the Document interface to call my external class using methods similar to those found in AbstractTableModel.
    You may ask why I would like to to this. I have specific reasons here, but more generally this would be helpful when saving or retrieving parameters set and displayed in a JTextField to a database, or when sharing JTextField to multiple users located on different machines.
    As to whether this is real MVC or not, I think it is but it really doesn't matter.
    I know that I can accomplish what I want for the JTextField using listeners. However, I would like my code for the JTables to be similarly structured to that of the JTextField.
    Thanks/Phil Troy

  • How to Create a Table in Oracle with XML data type.

    Dear ALL,
    What are the requirements for creating a table with xml datatype in Oracle: The steps would help very much to know the scripting of the table and how to query and either insert/update and remove data from that table.
    Any help, direction, advise would be highly appreciated.
    Thanks.

    Reffer to this Note.243554.1.
    In a nut shell you will need to run catqm.sql

  • [Table access] RFC with XML

    Hi everyone,
    The idea is to be able to read/write a table in the backend system (would it be R/3 or BW) from the Visual Composer.
    In a first attempt, I managed to do it by creating 2 RFCs: one for reading the table, another for modifying it. It works quite well.
    <u>Problem</u>
    1) Let's say I want to do it for a large number of tables: Do I have to build as much RFCs as there are tables ?
       In other words: Is there a way to do it generically ?
       <i>-> I did it in BSP but it is much simple since we can use reference (TYPE REF TO DATA)</i>
    <u>Bad idea</u>
    1) Concatenate all fields in a string
    -> Read: a lot of actions have to be performed to display the string in the tableview
    -> Write: ok as long as there is only string fields but as soon as there is something else, it a nightmare
    <u>Good Idea ?</u>
    1) Let's use XML to wrap fields up. It will be quick and easy by using CALL TRANSFORMATION on the backend
    <b>Question: How do we transform our XML to fit into the VC tableview ?</b>
    Thanks in advance.
    Best regards,
    Guillaume

    Hi Guillaume,
    I had the same problem a few months ago. There is no way to use a generic structure in VC. A workaround was my solution. I added a structure in SE11 with several strings. Each string for a column with values. This is not the best solution, but another isn't possible atm.
    XML is an alternative, but I never read something about using it in VC with tables. I think there is also the problem with the generic structure. At designtime VC doesn't know the structure of the XML file. When you use queries you can use define/test data service -> execute -> generate for each model.
    If somebody knows, if it is possible with XML, please give us a hint. I hope Mario will read this thread.
    Best Regards,
    Marcel

  • Call View controller with some URL parameter

    Hi
    I have a 3rd party system which need to send some data to my CRM system.
    One approch which is being suggested is by sending data by URL parameter.
    I have made a new component for this and have provided the 3rd party with its URL .
    The issue with calling a view controller URL along with some specific URL parameters is that i am not able to access its parameters.when i call method GET_PAGE_URL from the DOINIT method of the controller it does not provide me with the parameter list .
    How can i access these URL parameters ?
    Regards
    Ajitabh

    HI,
    have a look at component CRM_UI_FRAME. In the page default.htm they extract URL parameters.
    You have got the REQUEST variable in your view controller as well.
    cheers Carsten

  • Data passing from Adobe from submit button to BSP controller with XML

    Dear Friends
    How are you. I am developing one BSP application with Adobe interactive form. To complete this task I have use following linked solution. ( A PDF file that tells how to use Adobe forms with BSP application ).
    My application runs fine 50%. I did the same things what the tutorial told me and I am seeing the page in the webbrowser with Adobe from what i have developed.
    In the form I have put SUBMIT button and I have set properties as well... I have give full url as well for the controller to take data there over XML.
    In the controller I am not receiving any value. I have attached the code beneath as well... please tell me where I am making mistakes. I am thanking you. Any help will be appreciated.
    data: formxml type string.
    formxml = request->get_cdata( ).
    data: streamfactory type ref to if_ixml_stream_factory.
    data: istream type ref to if_ixml_istream.
    streamfactory = g_ixml->create_stream_factory( ).
    istream = streamfactory->create_istream_string( formxml ).
    data: document type ref to if_ixml_document.
    document = g_ixml->create_document( ).
    data: parser type ref to if_ixml_parser.
    parser = g_ixml->create_parser( stream_factory = streamfactory
                                    istream = istream
                                    document = document ).
    parser->parse( ).
    data: node type ref to if_ixml_node.
    data: strchecked type string.
    node = document->find_from_name( name = 'ACC_REQ').   <------ Node is empty
    strchecked = node->get_value( ).
    This is the link of the solution what i refered to complete this application:
    http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417500)ID0005508150DB01147043631230799453End?rid=/library/uuid/d0e58022-2a39-2a10-69a8-c1a892e2b3f4&overridelayout=true

    Dear Naeem,
    Actually i also tried the same link. For me its displayed the form. After giving the input when i click for submit nothing will happen.
    Its blinked and displayed the same page. I think for the node is getting value and some where its doesnt retrive the value.
    I will check and get back you soon once i found.
    Regards,
    Anita Vizhi Arasi B

  • Creating Table View's with more than one table

    I have two custom tables. 
    Table A has 2 fields:  Code and Description
    Table B has 4 fields:  Code, Country, Emp Group and Personnel Area
    I would like to build a view which has:  Code, Description, County, Emp Group and Personnel Area.  This view should be able to pull in the Description from Table A when the user enters in the Code.
    I have created a view with SE11 and have put both Table A and B with joins as follows:  A Code = B Code.  Under the view fields I have put the fields B.Code, A. Description, B.Country, B.Emp Group and B.Personnel Area.
    When I generate this view (Utilities, Table Maintenance Generator) it only shows the Code and Description field.  It does pull in the Description automatically which is great.  The issue is 2 things 1) The Description can be changed and 2) The other fields I specified above are not included on the view (e.g., Country etc.)
    Any ideas?

    I have checked several times that it is against the view as it is so strange that not all of the fields are appearing.
    I go into SE11, Click on View, Type in the View Name and then Change.  I goto into Utilities, Table Maintenance Generator and select it as one Step and then click on the Create Button.  When I go into SM30 I only see the 2 fields?

  • RSS Table View with Tab Bar Code Error

    I created an iphone app with a navigation controller that has a table view which displays an rss feed. My client wants it able to display multiple rss feeds through a tab bar. I have attempted several times and have messed up. If anyone could help me with this it would be greatly appreciated.

    Hi Guy, and welcome to the Dev Forum!
    I would recommend starting as follows:
    1) Start a new project with the Tab Bar Application template;
    2) Open MainWindow.xib and select Window->Document from the IB menu to make sure the xib window (the icon winow) is visible;
    3) Locate the "View Mode" switch in the upper-left corner of the xib window and make sure it's in the Center position to display a 2-column table showing the view hierarchy as a tree of small icons to the left;
    4) Expand the Tab Bar Controller branch, then delete (select and Edit->Delete) each of the two view controllers under the Tab Bar Controller. The only child of that controller should now be the Tab Bar;
    5) Open the Library window (Tools->Library), drag a Navigation Controller into the xib window and drop it when it's on top of the Tab Bar Controller icon;
    6) Repeat step 5 until you have as many nav controllers (one for each RSS feed) as you want (for this example, assume 4 RSS feeds);
    7) The Tab Bar Controller should now have 5 children: the Tab Bar plus the 4 nav controllers; if not, drag the nav controllers until each of their icons is shown indented under the Tab Bar Controller just as the Tab Bar is;
    8) Expand the first Navigation Controller branch, and expand it's Root View Controller; you should now see that root controller's Navigation Item;
    9) Select the nav item, open the Attributes Inspector (Cmd-1), and change the Title to "RSS 1 Root";
    10) Repeat 8-9 for the remaining 3 nav controller branches, so the root views will be labeled "RSS 2 Root", ... "RSS 4 Root" respectively;
    11) Save the xib, return to Xcode, and click "Build and Go". The project should build and run without any warnings or errors. If not, return to step 1 and try to see where things went wrong.
    Let us know if you need more help after you get the above skeleton app working. The next step will be to change the class of the "RSS 1 Root" controller to the class of the first table controller in your original project, and to add that controller's xib (you can delete FirstViewController.h/.m and SecondView.xib by selecting each in the Groups & Files tree of the Xcode project window and selecting Edit->Delete).
    Please avoid the temptation to merge the above steps into your original project. In my experience, moving each of your files into the new skeleton, and testing at each buildable stage will reduce the chances for error while making it easier to spot any incompatibilities in your old code. The process shouldn't involve touching any of your XML parse or table display code, but you may need to override some additional table view controller methods such as viewWillAppear:
    Btw, in case this hasn't been discussed yet, be aware you'll face a major decision soon: When tabbing to feed no. 2, what happens on the return to feed no. 1? If the user will return to the same detail view that was last displayed, you might need lots more memory and there will be lots more to go wrong. If the user will return to the home menu, the whole project will be much simpler. Estimate your effort accordingly.
    Also be prepared for your client to say something like this during beta: "Oh... one or two of the links in feed no. 3 might be a mp3 or mp4 next month. That won't be a problem, will it?".
    Hope that helps!
    \- Ray

  • Using interface builder to create a table view and add a cell

    So I am using interface builder to make a table view. Should be easy. I drag a table view controller to my view, then it seems I should be able to drag a table view cell to the table view but it won't let me drop it down. If I do it in the documents window it just replaces the table view with a cell. Seems like this shouldn't be hard, but it's one of those things that should take 2 seconds but I have been messing with it for hours. It seems like most of the examples I have looked at in the same code don't use iB so I haven't found a good reference. If somebody can point me in the write direction let me know.

    I struggled a bit too. Here's what I did on my recently completed app. I used IB to create the basic view and add the table. That's it. Then ensure your UIViewController based class implements the UITableViewDelegate and UITableViewDataSource protocols. Your cells will come from those methods, not anything you do in IB.
    If you're creating a set of screens that just have tables that allow you to navigate up and down through the data then IB isn't worth using at all.
    Just have your views extends UITableViewController and follow some of the supplied table based example apps.
    I rewrote my first app 3 times as I slowly figured all of this out.
    Hope that helps.

  • Can you select the row in a table view without highlighting the cell?

    I have an an app with a table view which is presented modally. Cell selections in this table are saved in the parent controller so that they can be reselected if the table is reloaded after being dismissed.
    When the cell is first highlighted, I want to momentarily highlight the cell and have it fade out, which I do by unselecting the cell from the modal view controller's didSelectRowAtIndexPath by calling setSelected:animated on the table view cell.
    However, when I present the table view controller modally again and want to display the previously selected cell as selected, I don't want the cell background to be highlighted, and I'm having trouble doing this.
    In order to make sure the table view knows the cell is selected, I am calling selectRowAtIndexPath. I need to make sure the cell is selected so that I can set/unset the cell's accessoryType. However, this has the sideeffect of highlighting the cell too, which looks weird and confusing to the user.
    I've tried things like temporarily setting the cell's selection style to none, but while that stops the cell background from highlighting? I've tried setting the selectionStyle to UITableViewSelectionStyleNone, but while this prevents the cell background from highlighting, the cell text still changes to white, so it the text is invisible against the white background.
    Is there a easy way of setting a cell to selected in the table view without also changing the highlight and text colour of the actual cell? Immediately setting the cell to be unselected still makes the highlight visible for a split second.

    I tried that, but setting the highlighted property doesn't seem to affect it.
    I figured out how what I was doing wrong though. I was setting selection style UITableViewSelectionStyleNone, selecting the cell, then setting the selection style back to whatever it had previously been. This causes the background not to draw highlighted, but the text and accessory type to still draw highlighted.
    In order to fix this, I moved the code to set the cell selection style to whatever it had previously been to the didDeselectRowAtIndexPath method.

  • Table View in View-based Application

    Hi.
    I want to use an UITableView in a View-based Application.
    All examples I found are for Navigation-based Applications.
    I Found only one example for View-based Applications, but it create all components himself without the Interface-Builder.
    I search an example with Interface-Builder.
    My main problem is, when i create a view with Interface-Builder, the controller class does not inherit from UITableViewController.

    GrinderFX wrote:
    I want to use an UITableView in a View-based Application.
    Hi, and welcome to the Dev Forum!
    Firstly, I would point out that you don't need to use UITableViewController to control a table view. The table view controller is just more convenient. So for example, you could simply drag a table view from the library in IB and drop it onto your view. Then you could hook up the table view's dataSource and delegate outlets to the File's Owner. Then you would add the data source and delegate protocols to the @interface of your UIViewController subclass and add the required data source and delegate methods to the @implementation.
    I mention the above because building your table view that way is very instructive. If you want to learn more about table views in general I would recommend Chapter 8 of +Beginning iPhone Development: Exploring the iPhone SDK by Mark and LaMarche+, which includes 3 table view projects that don't involve a navigation controller.
    My main problem is, when i create a view with Interface-Builder, the controller class does not inherit from UITableViewController.
    Returning to your specific question, IB allows you to change the class of an object. Here are the steps to use the View-Based Application template as you described (In the following I'm using Grinder as the name of the project; e.g. the app delegate class is named GrinderAppDelegate, and the view controller subclass is named GrinderViewController):
    1) _Change parent of view controller subclass in your code_
    In GrinderViewController.h, you only need to change the superclass from UIViewController to UITableViewController:
    @interface GrinderViewController : UITableViewController {
    However it will be easier later on if you make new files from the UITableViewController file template:
    a) Ctrl-click on GVC.h and GVC.m in the Groups & Files tree; select Delete->Also Move to Trash;
    b) Ctrl-click on Classes; select Add->New File->iPhone OS->Cocoa Touch Classes;
    c) Select UITableViewController subclass from the right center panel and click Next;
    d) File Name: GrinderViewController.m; check Also create GrinderViewController.h;
    e) Make sure the name for these new files is exactly the same as the ones you deleted; if you make a mistake here, delete the new files and start over, because that name must be the same in several other files;
    f) Click Finish; the replacement files should now appear under Classes.
    2) _Change the view controller class in IB_
    a) Double click on MainWindow.xib under Resources in the Groups & Files tree;
    b) Make sure the MainWindow.xib window is open by selecting Window->Document from the IB menu;
    c) Locate the View Mode switch, upper-left, in the xib window, and select the Center position;
    d) The xib window should now be displaying two columns with small icons on the left;
    e) Select the Grinder View Controller icon;
    f) Select Edit-Delete to delete that icon;
    g) Select Tools->Library from the menu, and expand Controllers in the Library Panel;
    h) Drag a Table View Controller to the xib window and drop it right under the app delegate icon;
    i) Select Tools->Identity Inspector from the menu to open the Grinder View Controller Identity Panel (the new Table View Controller should still be selected in the xib window);
    j) Under Class Identity, select Grinder View Controller from the list; tab out of the Class field to be sure the selection is recorded;
    k) Ctrl-Click on Grinder App Delegate and connect the view controller outlet (ctrl-drag) to Grinder View Controller;
    l) Expand GVC in the xib window and delete the Table View icon (since we want it in the other xib file);
    m) Reselect the GVC icon and open the Grinder View Controller Attributes panel;
    n) Under View Controller, select GrinderViewController from the NIB Name list;
    o) In the Table View Controller IB Editor window, select GrinderViewController.nib to open the other xib file;
    p) Make sure the GrinderViewController.xib window is open in small icon mode as in steps b-d above;
    q) The class of the File's Owner should be GrinderViewController;
    r) Delete the View icon;
    s) Drag a Table View from the Library to where the View icon was;
    t) Ctrl-click on File's Owner and connect (ctrl-drag) it's view outlet to the Table View;
    u) Ctrl-click on Table View: connect both the dataSource and delegate outlets to File's Owner;
    v) File->Save both xib files.
    3) _Make some rows in the table view and test_
    a) Open GrinderViewController.m in Xcode;
    b) Add the commented lines (be sure to use the correct line for your target OS);
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 20; // <-- change to more than zero
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    // Configure the cell
    // add this line for OS 2.x
    cell.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
    // add this line for OS 3.0
    // cell.textLabel.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
    return cell;
    c) Build and Go.
    I should add that the procedure might be a little easier if you start with the Window-Based Application Template. But the above is good practice in editing xib files.
    Hope that's helpful!
    - Ray

  • Going from one table view to another

    Hey there,
    I am new to creating apps and have a minor problem.
    I have my table view controller attached to my nav bar and it displays data from an array and has a detail disclosure indicator for 3 rows.
    I don't know what code to put in the prepare for segue function cause I want it to goto the next view controller which is a table view controller that also reads from an array.
    so 2 table views, both with arrays, how do I display the 2nd table view controller from the first, as I DON'T need to pass any data.
    Thanks in advance!

    I don't know what code to put in the prepare for segue function cause I want it to goto the next view controller which is a table view controller that also reads from an array.
    The 2nd table view controller should be the destination view controller of the push segue.  You do not need to override prepareForSegue unless you want to set properties on the destination view controller before it is loaded (i.e. pass data).

  • Question on multiple table view controllers

    Hey there,
    I don't need to know the exact code of how to do this, I am just wondering for now if this is the right way to do this.
    What I want is my Root View to have 3 prototype cells(including disclosure indicators), including a subtitle, and 1 button at the bottom of the prototype cells.
    When tapping a cell, (there are 3 different table view controllers that can open, depending on the cell chosen), it pushes to a Table View Controller that allows the user to tap a row they want, a check mark shows the row they tapped, then when they tap the back button to go back to the Root View, I want their choice from the Table VC they were just at, to show up in the subtitle field under the prototype cell they chose. Same goes for the other 2 prototype cells.
    Once the user has chosen all 3 and can see their choices in the prototype cell's subtitle, they can tap the submit button, and it will read from a database, querying all the selections from the 3 subtitles in the root view, and take them to a new Table VC that displays the results, with disclosure indicators for each selection from the database. They can go back to the Root VC, or they can choose a row from the database results and go into the Detail VC for that selection.
    I hope this makes sense, so I ask this:
    1. Is this the best way to pass data back to the Root VC, as in using the subtitle of the prototype cell's. I liked it because the subtitle is smaller than the cell so it shows what you chose from the Table VC you were at and checked a certain value from.
    2. If this is the way to do it, how do I pass the values from the Table VC that has a checkmark that you chose, back to the Root VC's subtitle for that cell you initially chose.
    Side note: The button on my Root VC takes up the whole width of the screen and i can't seem to change it, is there a way to customize the size with my mouse or do I need to write custom code?
    I am not at home so I can attach pics later as I have a 'not working model' that shows what I am doing and might be easier to udnerstand.
    Any help is definitely appreciated as I just need to know if I am on the right track.
    Thanks!!

    Hey there,
    I don't need to know the exact code of how to do this, I am just wondering for now if this is the right way to do this.
    What I want is my Root View to have 3 prototype cells(including disclosure indicators), including a subtitle, and 1 button at the bottom of the prototype cells.
    When tapping a cell, (there are 3 different table view controllers that can open, depending on the cell chosen), it pushes to a Table View Controller that allows the user to tap a row they want, a check mark shows the row they tapped, then when they tap the back button to go back to the Root View, I want their choice from the Table VC they were just at, to show up in the subtitle field under the prototype cell they chose. Same goes for the other 2 prototype cells.
    Once the user has chosen all 3 and can see their choices in the prototype cell's subtitle, they can tap the submit button, and it will read from a database, querying all the selections from the 3 subtitles in the root view, and take them to a new Table VC that displays the results, with disclosure indicators for each selection from the database. They can go back to the Root VC, or they can choose a row from the database results and go into the Detail VC for that selection.
    I hope this makes sense, so I ask this:
    1. Is this the best way to pass data back to the Root VC, as in using the subtitle of the prototype cell's. I liked it because the subtitle is smaller than the cell so it shows what you chose from the Table VC you were at and checked a certain value from.
    2. If this is the way to do it, how do I pass the values from the Table VC that has a checkmark that you chose, back to the Root VC's subtitle for that cell you initially chose.
    Side note: The button on my Root VC takes up the whole width of the screen and i can't seem to change it, is there a way to customize the size with my mouse or do I need to write custom code?
    I am not at home so I can attach pics later as I have a 'not working model' that shows what I am doing and might be easier to udnerstand.
    Any help is definitely appreciated as I just need to know if I am on the right track.
    Thanks!!

  • Input field in a table view control

    Hi,
        I have a table view control, with input field in one of the columns.
        That is meant for entering some values.
        My problem is when i am entering a 3 input field with value and then by   using     mouse control i enter say 20th input field with value.  After that when i use the directional keys to enter the 21st field, the cursor is not in 21st field, it is somewhere else.
    How to correct this problem.
    Regards,
    Vijayalakshmi

    Hi,
    Try to use the TABINDEX property of <input>.
    Best regards,
    Guillaume

Maybe you are looking for

  • Transportation Related DO - should only be procssed with shpmnt doc created

    I have 2 types of sales order. 1) one sales order "ZDIR-direct sales" does not requires transportation (Shipment document) thus the process related to it is sales orde - > Delivery order -> PGI -> invoice 2) other Order type is "ZTRN - Transportation

  • FCPX Share to Youtube Fail

    Hey all, Having some trouble exporting a project to YouTube.  Been working with this for a few weeks and have exported at least three drafts for a client with no issues, then today - no go.  Here is what I have done to try and remedy: clear cashe upd

  • Images turn to monochrome

    I have an E63, which I love, but it will frequently preview a linked image in the browser (normally, in full color), but when I click the image to download it or view it larger, the enlarged image is completely brown and only two-color.  It almost lo

  • Open script- how to automate RealTimeDecision center using Open Script

    Trying to automate Oracle Real time Decision center, but not able to capture the objects in the page, please help if Oracle Application Testing Suite supports Real time Decision center or is there any way to automate  Real time Decision. Thanks Nikit

  • Is it normal for my MacBook Pro to reach 210 degrees?

    During gaming my MacBook Pro will reach 210° F, without the fans audibly coming on... is this normal? It seems awfully high.