NSTableView howto?

  • Bastiaan

    Bastiaan - 2006-08-13

    Dear readers!

    I just discovered camelbones and i am by no means a perl expert nor am i an Obj-C programmer but i did manage to write me a small GUI programm which can write an input to a mysql database on a remote server.

    Now i would like to get the data thats stored in that mysql database and get it to be displayed in a NSTableView with seperate columns for the diffrent items in a row (example name, lastname, phone)

    I can't seem to find any documentation on the camelbones website on this issue, i hope that there is somebody out there that can show me an example on how to achieve this.

    Kind regards

    PS: Sorry for the bad english its not my daily language!

    • Bastiaan

      Bastiaan - 2006-08-13

      Part of the code, which works but will probably commented ;-)

      my $query1= $dbh->prepare("SELECT name, lastname, phone FROM phonebook WHERE name='$inputText' ORDER BY id");
              while(my($naam, $lastname, $phone) = $query1->fetchrow_array()) {
              $self->textLabel()->setStringValue("$name $lastname $phone");

    • Bastiaan

      Bastiaan - 2006-08-14

      No replies yet! Is there a camelbones expert out there that can help me?

      If you need additional info please ask!

    • Sherm Pendley

      Sherm Pendley - 2006-09-29

      Have a look at the example code in /Developer/Examples/CamelBones/Data Access/.

      The data in that example is taken from /etc/services, not from a database, but it does illustrate how to create a data source to provide data for an NSTableView.


Log in to post a comment.