-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update two deprecated methods to up-to-date version #364
base: master
Are you sure you want to change the base?
Conversation
…ollerAnimated: & presentModalViewController:animated:
Thanks for suggesting this. I think the new methods are only available on iOS 5 and upwards unfortunately, and my understanding is ASIHTTPRequest is currently aiming to work on iOS 3 upwards. |
(I don't know if it might be appropriate to add ifdefs around your change somehow, or perhaps to use pragma's to silence the warnings - it's definitely not good that we have warnings appearing!) |
Yep, that's right~ No warnings, right?~Um, according to the message from xcode, it is used after ios 6.0. So I think it might be good if checks like[[UIDevice currentDevice] systemVersion] are done? (I don't know if it might be appropriate to add ifdefs around your change somehow, or perhaps to use pragma's to silence the warnings - it's definitely not good that we have warnings appearing!) ¡ª |
No, it's not a good idea to check the system version. You could, though, check at run-time if the object responds to a particular message (the new method name) like this: if ([viewController respondsToSelector:@selector(dismissModalViewControllerAnimated:completion:)])
[viewController dismissModalViewControllerAnimated:YES completion:nil];
else
[viewController dismissModalViewControllerAnimated:YES]; |
Ah! Right, this is a pretty good idea. Thanks for the advice~ Date: Mon, 27 May 2013 21:51:23 -0700 No, it's not a good idea to check the system version. You could, though, check at run-time if the object responds to a particular message (the new method name) like this: if ([viewController respondsToSelector:@selector(dismissModalViewControllerAnimated:completion:)]) ¡ª |
Sure! |
update deprecated method to up-to-date version, dismissModalViewControllerAnimated: & presentModalViewController:animated:, to dismissViewControllerAnimated:completion: & presentViewController:animated:completion:.