In objective c we use try catch to stop crashing e.g.
- (void)viewDidLoad {
[super viewDidLoad];
tableData = [NSArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto", @"Full Breakfast", @"Hamburger", @"Ham and Egg Sandwich", @"Creme Brelee", @"White Chocolate Donut", @"Starbucks Coffee", @"Vegetable Curry", @"Instant Noodle with Egg", @"Noodle with BBQ Pork", @"Japanese Noodle with Pork", @"Green Tea", @"Thai Shrimp Cake", @"Angry Birds Cake", @"Ham and Cheese Panini", nil];
@try {
NSLog(@"%@",tableData[1000]);
} @catch (NSException *exception) {
NSLog(@"%@",exception);
}
}
But when I am using swift 3 , warning showing and application crashed
Can anyone explain, how can i stop this. I read some topics from google but couldn't understand. Can any one help me out.