use deprecated methods in iOS 5

左心房为你撑大大i 提交于 2019-12-23 12:53:56

问题


I recently upgraded my application from iOS3 to iOS5. And at compile time I have several warnings for using deprecated methods.

Two questions:

1- Will I have problems when run the application in an iPhone with iOS 5?

2- If I did not update the methods, Will Apple accept the application when uploading it to the AppStore?


回答1:


  1. You will probably not have a problem on iOS 5 devices using methods that the compiler is telling you are deprecated. Of course, it would be a good thing to clear up this issue over time because deprecated means those methods might not be present in iOS 6 (or whatever it will be called).

    • What you need to watch out for are compiler warnings or errors that an object may not respond to a particular method call. These would occur for methods that actually were removed along the way. It sounds like you have already done this, but be sure that you have set your SDK set to iOS 5 in XCode to ensure you are getting all the errors/warnings. But the lesson here is test, test, test (on devices as well).
  2. As long as your code compiles and runs against iOS 5, using a deprecated method alone probably won't get your app disqualified. If it causes any crashing or anything like that during testing, however, they will likely kick it back to you for rework.




回答2:


Briefly,

  1. No.
  2. Yes.

See the dupe question for a longer explanation.




回答3:


Deprecated doesn't mean removed. Its just a friendly hint for you that these functions might be gone in an future iOS version (eg. 6). Currently they still work and the review team will accept your binary. You should note that the lifetime of deprecated methods in iOS seems to be pretty long, a few methods from NSFileManager are deprecated since iOS 2 (aka iPhone OS 2.0)

However, you are encouraged to update your App at some time, if you have a critical update that needs to be out asap, you can skip this for now, but in the future you have to change your code!




回答4:


  1. Test it. You may not have a problem now but you will likely in the future.
  2. You should be okay (Assuming it actually works) but Apple is fickle. No guarantees.


来源:https://stackoverflow.com/questions/8840942/use-deprecated-methods-in-ios-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!