Note that there are some explanatory texts on larger screens.

plurals
  1. PO(Terminating app due to uncaught exception 'NSInvalidArgumentException)
    primarykey
    data
    text
    <p>I am using uitableview for showing the json parsed data . the parsed data is stored in array and the array list is 100 asigned to uitableview. but it crashing at objectAtIndex at <strong>{forloop}</strong> it showing crash report as</p> <p><strong>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '<em></strong> -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'</em>*</p> <p>plese help me </p> <pre><code> - (void)viewDidLoad { self.responseData = [NSMutableData data]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:openexchangeURl]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; [super viewDidLoad]; } - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [responseData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [connection release]; self.responseData = nil; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { [connection release]; NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; self.responseData = nil; values = [responseString JSONValue]; array = [[NSMutableArray alloc] init]; NSMutableArray *arrTitle = [[NSMutableArray alloc] init]; NSMutableArray *arrValues = [[NSMutableArray alloc] init]; array =[values valueForKey:@"rates"]; NSLog(@"array values:--&gt; %@",array); // NSLog(@"values:--&gt; %@",values); // NSLog(@"Particular values:--&gt; %@",[[values valueForKey:@"rates"] valueForKey:@"AED"]); tempDict1 = (NSMutableDictionary *)array; NSArray *arr;// =[[NSArray alloc]init]; arr = [[tempDict1 valueForKey:@"rates"] componentsSeparatedByString:@";"]; NSLog(@"arr--&gt;%@",arr); NSString *subStar = @"="; [arrTitle removeAllObjects]; [arrValues removeAllObjects]; for (int i=0; i&lt;[arr count]-1; i++) { [arrTitle addObject:[[arr objectAtIndex:i] substringToIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:subStar])-1]]; [arrValues addObject:[[arr objectAtIndex:i] substringFromIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:subStar])]]; NSLog(@"arrTitle is:--&gt; %@",arrTitle); } tempDict1 = (NSMutableDictionary*)[array objectAtIndex:0]; array = [values valueForKey:@"rates"]; NSLog(@"tempDict--%@",[tempDict1 objectForKey:@"AED"]); [array retain]; [tbl_withData reloadData]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"array--&gt;%@",array); return [array count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { intIndexPath = indexPath.row; static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.textLabel.adjustsFontSizeToFitWidth = YES; cell.textLabel.font = [UIFont systemFontOfSize:8]; cell.textLabel.numberOfLines = 4; } // NSLog(@"data is like:--&gt; %@",array); // cell.textLabel.text= [NSString stringWithFormat:@"%@",[array objectAtIndex:intIndexPath]]; cell.textLabel.text =[array objectAtIndex:intIndexPath]; return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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