update two deprecated methods to up-to-date version #364

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

update deprecated method to up-to-date version, dismissModalViewControllerAnimated: & presentModalViewController:animated:, to dismissViewControllerAnimated:completion: & presentViewController:animated:completion:.

Haowei ZHANG update deprecated method to up-to-date version, dismissModalViewContr…
…ollerAnimated: & presentModalViewController:animated:
3f44ccb
Collaborator

jogu commented May 22, 2013

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.

Collaborator

jogu commented May 22, 2013

(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?
Haowei
Date: Wed, 22 May 2013 01:31:43 -0700
From: notifications@github.com
To: asi-http-request@noreply.github.com
CC: haoweiz@outlook.com
Subject: Re: [asi-http-request] update two deprecated methods to up-to-date version (#364)

(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!)

¡ª
Reply to this email directly or view it on GitHub.

Contributor

AriX commented May 28, 2013

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
From: notifications@github.com
To: asi-http-request@noreply.github.com
CC: haoweiz@outlook.com
Subject: Re: [asi-http-request] update two deprecated methods to up-to-date version (#364)

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];

¡ª
Reply to this email directly or view it on GitHub.

Contributor

AriX commented May 28, 2013

Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment