Note that there are some explanatory texts on larger screens.

plurals
  1. POUITAbleView Giving Error
    text
    copied!<pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { //NSLog(@"Array: %@",rows); return [rows count];// AT THIS LINE } </code></pre> <p>Program received signal: “EXC_BAD_ACCESS”</p> <p>THANKS FOR THE REPLY Actually I have attached it to the WebPage By NSUrl where I have made a PHP array and I have created a NSLOG where I am getting the Values in the array form but When It exceute the line return [rows count];. It gives error when I am writting statically <code>return 2;</code> then it execute. I am explaining to you what I am doing. I am initialising the NIb with</p> <pre><code>Name tableViewController=[[JsonTestViewController alloc] initWithNibName:@"JsonTestViewController" bundle:nil]; </code></pre> <p>In <code>JsonTestViewController.m</code> I have this code:</p> <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { //NSLog(@"Array: %@",rows); return [rows count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } // Configure the cell. NSDictionary *dict = [rows objectAtIndex: indexPath.row]; NSString *strlb1=[dict objectForKey:@"block"]; NSString *strlb2=[dict objectForKey:@"name"]; strlb1=[strlb1 stringByAppendingString:@" , "]; strlb1=[strlb1 stringByAppendingString:strlb2]; NSString *str1=@"FPS : "; NSString *str2=[dict objectForKey:@"p_hours"]; NSString *strpinf; if([str2 isEqualToString:@"FP"]) { strpinf=@"Free Parking"; } else if([str2 isEqualToString:@"12"]) { strpinf=@"2 hours"; } else if([str2 isEqualToString:@"14"]) { strpinf=@"4 hours"; } else if([str2 isEqualToString:@"MP"]) { strpinf=@"Metered Parking"; } str1=[str1 stringByAppendingString:strpinf]; cell.textLabel.text =strlb1; cell.detailTextLabel.text = str1; return cell; } - (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [NSURL URLWithString:@"SITE URL"]; NSString *jsonreturn = [[NSString alloc] initWithContentsOfURL:url]; NSData *jsonData = [jsonreturn dataUsingEncoding:NSUTF32BigEndianStringEncoding]; NSError *error = nil; NSDictionary * dict = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&amp;error]; if (dict) { rows = [dict objectForKey:@"users"]; } NSLog(@"Array: %@",rows); [jsonreturn release]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end </code></pre>
 

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