gpt4 book ai didi

ios - 如何找出这些错误。我的应用程序崩溃了 6 次(来自应用程序分析的报告)?

转载 作者:行者123 更新时间:2023-11-29 00:17:51 25 4
gpt4 key购买 nike

这些错误是什么以及如何找出这些错误。在我的应用程序中,我使用 GoogleAnalytics、Fabric、Mix 面板、Core Data,我正在向服务器发送参数并从服务器获取数据。

这是我的代码:

- (IBAction)searchButton:(id)sender {

if (sender == self.searchButton) {

Reachability *networkReachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [networkReachability currentReachabilityStatus];

if (networkStatus == NotReachable) {

UIAlertController * alert = [UIAlertController alertControllerWithTitle : @"Message"
message : @"No Internet!Please Connect and try again."
preferredStyle : UIAlertControllerStyleAlert];

UIAlertAction * ok = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{ }];

[alert addAction:ok];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alert animated:YES completion:nil];

});

// NSLog(@"There IS NO internet connection");
} else {


if ([self.selectOptionButton.currentTitle isEqualToString:@"Select Your Option"]) {

UIAlertController * alert = [UIAlertController alertControllerWithTitle : @"Message"
message : @"Please select option."
preferredStyle : UIAlertControllerStyleAlert];

UIAlertAction * ok = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{ }];

[alert addAction:ok];
[self presentViewController:alert animated:YES completion:nil];

} else if ([self.textField.text isEqualToString:@""]) {

UIAlertController * alert = [UIAlertController alertControllerWithTitle : @"Message"
message : @"Please enter number."
preferredStyle : UIAlertControllerStyleAlert];

UIAlertAction * ok = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{ }];

[alert addAction:ok];
[self presentViewController:alert animated:YES completion:nil];

} else {

NSString * key1 = @"Something";
NSString * key2 = @"Something";
NSString * key3;
if ([self.optionButton.currentTitle isEqualToString:@"No0"]) {
key3 = @"0";
} else if ([self.optionButton.currentTitle isEqualToString:@"No1"]) {
key3 = @"1";
} else if ([self.optionButton.currentTitle isEqualToString:@"No2"]) {
key3 = @"2";
} else if ([self.optionButton.currentTitle isEqualToString:@"No3"]) {
key3 = @"3";
} else if ([self.optionButton.currentTitle isEqualToString:@"No4"]) {
key3 = @"4";
}

NSString * str;
NSArray * arr = [NSArray arrayWithObjects:self.key4, key1, key2, self.textField.text, key3, self.systemDateTime, self.key5, self.key6, nil];

str = [arr componentsJoinedByString:@"~"];



self.tempURLString = [[NSString alloc] initWithFormat:@"http://hostname/%@.php?da=%@", self.string, str];



//Getting data from server through JSON approach ...
self.urlSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
self.urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:self.tempURLString]];
self.dataTask = [self.urlSession dataTaskWithRequest:self.urlRequest completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {

NSMutableDictionary *serverRes = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];

self.integer = [[serverRes objectForKey:@"str"] count];

if (!(error == nil)) {

UIAlertController * alert = [UIAlertController alertControllerWithTitle : [error localizedDescription]
message : [error localizedRecoverySuggestion]
preferredStyle : UIAlertControllerStyleAlert];

UIAlertAction * ok = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{ }];

[alert addAction:ok];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alert animated:YES completion:nil];

});

// NSLog(@"%@", error);
} else {

if (serverRes == nil || self.integer == 0) {

UIAlertController * alert = [UIAlertController alertControllerWithTitle : @"Message"
message : @"Please enter valid number."
preferredStyle : UIAlertControllerStyleAlert];

UIAlertAction * ok = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{ }];

[alert addAction:ok];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alert animated:YES completion:nil];

});

// NSLog(@"Data Nil.....");
} else {

[self.array1 removeAllObjects];
[self.array2 removeAllObjects];
[self.array3 removeAllObjects];
[self.array4 removeAllObjects];
[self.array5 removeAllObjects];
[self.array6 removeAllObjects];
[self.array7 removeAllObjects];
[self.array8 removeAllObjects];
[self.array9 removeAllObjects];
[self.array10 removeAllObjects];

for (int i=0; i<self.integer; i++) {

[self.array1 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str1"]];
[self.array2 addObject:[[[serverRes objectForKey:@"sStr"] objectAtIndex:i] objectForKey:@"str2"]];
[self.array3 addObject:[[[serverRes objectForKey:@"sStr"] objectAtIndex:i] objectForKey:@"str3"]];
[self.array4 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str4"]];
[self.array5 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str5"]];
[self.array6 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str6"]];
[self.array7 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str7"]];
[self.array8 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str8"]];
[self.array9 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str9"]];
[self.array10 addObject:[[[serverRes objectForKey:@"str"] objectAtIndex:i] objectForKey:@"str10"]];

}

//Reload tableView Data...
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
}

}
}];

[self.dataTask resume];


}
}
}
}

错误是... This is first error

This is second error

This is third error

This is my fourth error

这些错误的确切含义是什么以及如何解决这些错误?

最佳答案

enter image description here

您可以创建断点来定位错误行。

关于ios - 如何找出这些错误。我的应用程序崩溃了 6 次(来自应用程序分析的报告)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44823524/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com