它顯示警告代碼將永遠不會執行。我檢查了3次我的代碼,但不知道如何解決此警告?如何解決此警告目標c中的「代碼將永遠不會執行」?
[[[[self.dbRef child:@"Status"] child:user.uid] child:@"Details"] observeSingleEventOfType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot * _Nonnull snapshot) {
//Add Current User Image.....
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me?fields=name,picture.height(100).width(100)" parameters:nil]startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
//NSLog(@"Result is : %@",result);
NSDictionary *dictionary = (NSDictionary *) result;
NSDictionary *data3 = [dictionary objectForKey: @"picture"];
NSDictionary *data2 = [data3 objectForKey: @"data"];
NSString *photoURL = (NSString *)[data2 objectForKey:@"url"];
NSData *imgData = [NSData dataWithContentsOfURL: [NSURL URLWithString: photoURL]];
cell.imgUser.image = [UIImage imageWithData: imgData];
[tableView reloadData];
}];
//Show current user name....
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me?fields=name,picture.height(100).width(100),name" parameters:nil]startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
NSString *currentUName = snapshot.value[@"name"];
NSArray *currentUNameArr = [NSArray arrayWithObject:currentUName];
cell.lblUName.text = currentUNameArr[indexPath.row];
[tableView reloadData];
}];
} withCancelBlock:^(NSError * _Nonnull error) {
NSLog(@"%@",error.localizedDescription);
}];
您在哪條線上得到該警告? –
第一行.. –
問題出在第一行之前。可能是一個總是正確或錯誤的條件,或者一個「返回」語句。 – Willeke