• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Populating TableView Via Button.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Populating TableView Via Button.


  • Subject: Re: Populating TableView Via Button.
  • From: Sean Kline <email@hidden>
  • Date: Fri, 18 Sep 2009 10:44:43 -0400

Would an alternative implementation be to have the button click swap in a
view with a NSTableView bound to its data source?
-S

On Fri, Sep 18, 2009 at 9:34 AM, Philip Juel Borges <email@hidden
> wrote:

> Hi!
>
> Does anyone know how you'd populate a tableview when clicking a button? I
> tried this:
>
> AppController.h:
>
> - (void)populateTableView:(id)sender;
>
> AppController.m:
>
> -(void)populateTableView:(id)sender {
>
>        [super init];
>        sourceArray =  [NSArray arrayWithObjects:
>                                        [NSDictionary
> dictionaryWithObjectsAndKeys:
>                                         @"test 1", @"title",
>                                         [NSURL fileURLWithPath:@"/Library/1.html"],
> @"url", nil],
>                                        [NSDictionary
> dictionaryWithObjectsAndKeys:
>                                         @"test 2", @"title",
>                                         [NSURL fileURLWithPath:@"/Library/2.html"],
> @"url", nil],
>                                        [NSDictionary
> dictionaryWithObjectsAndKeys:
>                                         @"test 3", @"title",
>                                         [NSURL fileURLWithPath:@"/Library/3.html"],
> @"url", nil],
>                                        [NSDictionary
> dictionaryWithObjectsAndKeys:
>                                         @"test 4", @"title",
>                                         [NSURL fileURLWithPath:@"/Library/4.html"],
> @"url", nil],
>
>                                        nil];
>
>        return self;
>
> }
>
> This doesn't work. If I replace the void function in the class .m file with
> (id) init, everything works fine. But then it populates the tableview on
> launch and I'd like to populate the tableView only when I click a button.
>
> --Philip
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Populating TableView Via Button.
      • From: Volker in Lists <email@hidden>
References: 
 >Populating TableView Via Button. (From: Philip Juel Borges <email@hidden>)

  • Prev by Date: Re: +keyPathsForValuesAffecting<Key> not working for a category-implemented property on a CoreData class
  • Next by Date: If someone could inspect this code and explain to me what am I doing wrong ?
  • Previous by thread: Re: Populating TableView Via Button.
  • Next by thread: Re: Populating TableView Via Button.
  • Index(es):
    • Date
    • Thread