Help me ...Terminating app due to uncaught exception 'NSRangeException',
By : Joey
Date : March 29 2020, 07:55 AM
should help you out does the array has any data when you show the table? if you give a default number of cells that is bigger than 0 and there is no data in the array..then you will receive the error you described. code :
'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array'
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [appDelegate.ArrParseData count];
}
|
Terminating app due to uncaught exception 'NSRangeException'
By : Grande
Date : March 29 2020, 07:55 AM
|
Terminating app due to uncaught exception 'NSRangeException'
By : Hannah Wilson
Date : March 29 2020, 07:55 AM
I wish did fix the issue. You have a bug. Something isn't working as you expect it to work. If you insist that the bug is in the code that you posted, and that the code that you posted is correct, then you'll never find out the problem in your life. There's a crash. Rule 1: The crash is your fault. Your code is wrong. Your task is to find which code is wrong.
|
App Terminating due to uncaught exception 'NSRangeException'
By : Tsrtcc Buses
Date : March 29 2020, 07:55 AM
should help you out 9223372036854775807 is the unsigned cast of -1, which is NSNotFound. Per the error message, you are calling -[NSString substringToIndex:] with the result of a search that didn't find what you were looking for. This section of code is not shown, so look for anywhere where you think you can pull apart a string, but are not properly checking that you actually can. Try running with the debugger attached and it will tell you which line of your code raises the exception reported. You can work backwards from there.
|
Terminating app due to uncaught exception 'NSRangeException'. libc++abi.dylib: terminating with uncaught exception of ty
By : JADORE
Date : March 29 2020, 07:55 AM
it helps some times The problem is in this line let formatted_address = ide![0] If an array is empty, you can't get it's first element with [0] because there is no element at all! code :
if ide!.count > 0 {
//Your code
}
if let id = request!["results"], let ide = id as? NSArray {
let formatted_address = ide[0]
let fors = formatted_address as! NSDictionary
//rest of your code
}
|