NSURL *url = [NSURL URLWithString:urlStr];返回nil

1,058 阅读1分钟

NSString *urlStr = [NSString stringWithFormat:@"mqqapi://card/show_pslcard?src_type=internal&version=1&uin=%@&key=%@&card_type=group&source=external", weakSelf.courseModel.qq, weakSelf.courseModel.qqIdKey];

现象:打印urlStr是有值的 打印url却为nil

原因:后台录入qqkey的时候带了空格 因为没有做UTF-8编码导致 获取的url为nil