Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem to put data in UITableView
    primarykey
    data
    text
    <p>i write this code </p> <pre><code>- (void)requestFinished:(ASIHTTPRequest *)request { // Use when fetching text data NSString *responseString = [request responseString]; dataToDisplay = [[NSMutableArray alloc] init]; //NSString *myJSON = [[NSString alloc] initWithString:responseString]; NSDictionary *json = [responseString JSONValue]; Status *statut = [[Status alloc] init]; statut.flyNumber = [json objectForKey:@"flynumber"]; statut.ftatuts = [json objectForKey:@"fstatuts"]; statut.escDepart = [json objectForKey:@"escdepart"]; statut.escArrival = [json objectForKey:@"escarrival"]; statut.proArrival = [json objectForKey:@"proarrival"]; statut.proDepart = [json objectForKey:@"prodepart"]; statut.estDepart = [json objectForKey:@"estdepart"]; statut.estArrival = [json objectForKey:@"estarrival"]; statut.realDepart = [json objectForKey:@"realdepart"]; statut.realArrival = [json objectForKey:@"realarrived"]; [dataToDisplay addObject:statut]; NSLog(@"ok"); } - (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 [dataToDisplay count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... NSLog(@"1 ok"); Status *statut2 = [dataToDisplay objectAtIndex:indexPath.row]; NSLog(@"2 ok"); cell.textLabel.text = [NSString stringWithFormat:@"%@ - %@",statut2.flyNumber,statut2.ftatuts]; NSLog(@"3 ok"); return cell; } </code></pre> <p>The problem that the table still empty . And i don't have "ok 1" message in the console . This is my controller .h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "ASIHTTPRequest.h" #import "JSON.h" #import "Status.h" @interface StatusTableViewController : UITableViewController { NSString * Flynumber; NSMutableArray *dataToDisplay; } @property(retain,nonatomic) IBOutlet NSString * Flynumber; @end </code></pre> <p>i added <code>[self.tableView reloadData];</code> and it work . <img src="https://i.stack.imgur.com/ALKzD.png" alt="enter image description here"></p> <p>But how to put each result on a line (cell) ?</p>
    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. 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