Menu

How to add switcher to UITableViewItem?

Chris
2014-01-20
2014-01-25
  • Chris

    Chris - 2014-01-20

    Hi
    Is it possible to add switcher to each UITableViewItem?
    Is there a reference manual on how to use each of the component?
    By the way, this is a very good component to use!

    please advise
    Thanks
    Chris

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-20

    Hi Chris

    See TableViewCustomCell demo, and add your component on the cell,

    Regards

     
  • Chris

    Chris - 2014-01-21

    Hi
    I tried to run the TableViwCustomCell demo and it crashed!
    The app can't even start up on Simulator Debug / Release mode.

    please help

    thanks
    chris

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-21

    Hi Chris

    I've run it, and don't see any problem!

    Regards

     
  • Chris

    Chris - 2014-01-22

    hi
    when i run it on the iOS simulator in debug mode, it gave me an SIG ABORT (6) which i don know why. On release mode, the app started and closed immediately.
    Should i run in on iOS device instead?

    thanks
    chris

     
  • Chris

    Chris - 2014-01-22

    Hi
    Btw, i am using XE5 update 2 hot fix 3. Have not use the hot fix 4 yet.
    I tried uploading the app to the iPad but still crashed when loaded.

    thanks
    chris

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-22

    Hi Chris

    I test it again on Simulator and iPhone 4 and no problem,
    What is your:

    iOS version ?
    Xcode version ?

    Regards

     

    Last edit: Babak Yaghoobi 2014-01-22
  • Chris

    Chris - 2014-01-23

    hi
    The iOS simulator is 7.0.3.
    The iOS is also 7.0.3

    Xcode is Version 5.0.2 (5A3005)

    thanks
    chris

     
  • Gordon

    Gordon - 2014-01-23

    I am getting the same error.. but really, I like the TableViewCustomViewframe better as a demo..
    using a custom frame in a table is a little tricky.. Took me a while and a little help to understand how to update the cache.. You will need some sort of array of sorts to keep track of the states.. (Unless you are only going to use the switch, and then you can just use the tag, which can be used as cargo)
    Once you get it, you will love creating your own look to your tables.

     
  • Chris

    Chris - 2014-01-23

    Hi Gordon
    Thanks for your advise. I will look into the TableViewCustomViewFrame demo.
    Hope can have more sharing of information on using these components.
    They are very good.

    Thanks
    chris

     
    • Gordon

      Gordon - 2014-01-23

      No worries.. Feel free to contact me privately , I dont mind helping.. Babak helped me so much.. I want to share.
      Im no expert, but have found my way around.. Worth all of the time.. I now, as of yesterday, have my app done.. not as pretty as Id liked.. but works well. Using KBMMW for all of my database stuff, and DPF.. Pretty dang cool!

       

      Last edit: Gordon 2014-01-23
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-23

    Hi

    This demo need cells.xml file in the Resources folder, may be this file not in deployment window or something else !

    Regards

     
  • Chris

    Chris - 2014-01-25

    Hi Babak

    For the demo on TableViewCustomCell, i modified the FormCreate to trap the error.

    ====== modified with try block ======
    procedure TMainForm.FormCreate( Sender: TObject );
    var
    XmlDoc: TXMLDocument;
    i : Cardinal;
    begin
    // load the xml file
    XmlDoc := TXMLDocument.Create( self );
    try
    XmlDoc.DOMVendor := GetDOMVendor( 'ADOM XML v4' );
    // XmlDoc.LoadFromFile( GetAppFolder( ) + 'cells.xml' );
    XmlDoc.LoadFromFile('cells.xml');

    // Store cells in IXMLNodeList
    cells := XmlDoc.DocumentElement.ChildNodes['cells'].ChildNodes;

    DPFUITableView1.Sections.Add;
    // Insert the same quantity of tableitems than cell node in xml
    for i := 0 to cells.Count - 1 do
      DPFUITableView1.Sections[0].TableItems.Add;
    

    except
    on E:Exception do
    FMsg := e.Message;
    end;
    DPFTextView1.Text := Fmsg + ' ' + GetAppFolder();
    end;

    ==================================

    When the app is executed, the error is displayed "Cannot open file "/cells.xml". Not a directory. /Users/<username>/Library/Application Support/iPhone Simulator/7.0.3/"

    This is running on simulator. How can i deploy the cells.xml to /Users/<username>/Library/Application Support/iPhone Simulator/7.0.3/ directory?

    please advise

    thanks
    chris

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-25

    Hi chris,

    Go to menu: Project->Deployment you must be see cell.xml file in the list, delete this row and click Add files button, goto Resources folder and select cell.xml file, and press deploy button.

    regards

     
  • Chris

    Chris - 2014-01-25

    hi babak
    I tried debugging the program. I found out that i do have the cells.xml
    however, the error occurs in this function TMainForm.DPFUITableView1DrawCell

    I removed the first 11 xml records (i.e. only <type>list</type> and <type>view</type> are left in the cells.xml)

    These 2 types gave a SIGABRT(6) exception class.

    please advise

    thanks
    chris

     
  • Chris

    Chris - 2014-01-25

    hi babak
    I tried debugging the program. I found out that i do have the cells.xml
    however, the error occurs in this function TMainForm.DPFUITableView1DrawCell

    I removed the first 11 xml records (i.e. only <type>list</type> and <type>view</type> are left in the cells.xml)

    These 2 types gave a SIGABRT(6) exception class.

    please advise

    thanks
    chris

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-25

    Can you deploy cell.xml to Simulator or device ?

     
  • Chris

    Chris - 2014-01-25

    hi babak.
    yup. the cell.xml is in the simulator and device.

    I think it had problem in the function DrawCell for the this

    <cell>
        <type>list</type>
        <text>
            <line>line 1</line>
            <line>line 2</line>
            <line>line 3</line>
            <line>line 4</line>
            <line>line 5</line>
        </text>
    </cell>
    <cell>
        <type>view</type>
        <text>My View</text>
    </cell>
    

    thanks
    chris

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.