After updating Xcode to version 4.2 I received the following warning in my current project:
warning: ‘NSDate’ may not respond to ‘initWithString:’
What must I do? 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This method is in the documentation only noted at the Mac OSX page, not the iOS.
Why Apple has different versions is unclear to me, but they luckily respond the same.
Because the class reference for iOS says there is no such method for iOS NSDate, you get the warning.
Your code, however, will respond perfectly fine.
To silence the warning, you should indeed use NSDateFormatter.
Regards,
Jacco