Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Following is a short implementation based on your description. It seems to behave correctly. I hope you will find what is missing.</p> <p>Regards</p> <p>ViewController.nib consists of a single UITableView including an UIButton (calling addApplications)</p> <p>ViewController.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface ApplicationViewController : UIViewController @property NSString* name; @end @interface ViewController : UITableViewController @property ( nonatomic, retain ) NSArray* mesApplications; - ( IBAction ) addApplications: ( id ) sender; @end </code></pre> <p>ViewController.m</p> <pre><code>#import "ViewController.h" @implementation ApplicationViewController @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.mesApplications.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* cell = [ tableView dequeueReusableCellWithIdentifier: @"MyTableViewCell" ]; if ( !cell ) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyTableViewCell"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } ApplicationViewController* pApp = [ self.mesApplications objectAtIndex: indexPath.row ]; [ cell.detailTextLabel setText: pApp.name ]; NSLog(@"%@", pApp); return cell; } - ( IBAction ) addApplications: ( id ) sender { ApplicationViewController* pApp1 = [ ApplicationViewController new ]; pApp1.name = @"app1"; ApplicationViewController* pApp2 = [ ApplicationViewController new ]; pApp2.name = @"app2"; ApplicationViewController* pApp3 = [ ApplicationViewController new ]; pApp3.name = @"app3"; self.mesApplications = [ NSArray arrayWithObjects: pApp1, pApp2, pApp3, nil]; [self.tableView reloadData]; } @end </code></pre> <p>And console dump</p> <pre><code>2013-03-11 13:38:17.132 kokio[10353:907] &lt;ApplicationViewController: 0x1c535190&gt; 2013-03-11 13:38:17.139 kokio[10353:907] &lt;ApplicationViewController: 0x1c535260&gt; 2013-03-11 13:38:17.142 kokio[10353:907] &lt;ApplicationViewController: 0x1c535390&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload