***-[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

字典传空值报错
字典传值前加入判断
如用户名密码textfield为空

UITextField *userName = (UITextField *)[self.xxxXibView viewWithTag:1];

UITextField *psw = (UITextField *)[self.xxxXibView viewWithTag:2];

if (userName.text != nil && psw.text != nil){

    NSDictionary *dict = @{@"UserName": userName.text, @"Password": psw.text}; 
}

Dean
34 声望1 粉丝

哦也