Skip to content

Conversation

haowei-zhang
Copy link

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

…ollerAnimated: & presentModalViewController:animated:
@jogu
Copy link
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.

@jogu
Copy link
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!)

@haowei-zhang
Copy link
Author

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: [email protected]
To: [email protected]
CC: [email protected]
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.

@AriX
Copy link
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];

@haowei-zhang
Copy link
Author

Ah! Right, this is a pretty good idea. Thanks for the advice~

Date: Mon, 27 May 2013 21:51:23 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
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.

@AriX
Copy link
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants