A Lot of Functions are deprecated - iOs 6

2019-01-13 10:31发布

问题:

I have a few functions that are deprecated since iOs 6. Maybe this'll be helpful for others who also just updated to iOs 6.

    [self presentModalViewController:pNewController animated:YES];
 presentModalViewController:animated is deprecated since iOs 6

 Autosynthesized property 'String' will use synthesized instance variable '_String', not existing instance variable 'String'

Autosynthesized property 'phonenumber' will use synthesized instance variable '_phonenumber', not existing instance variable 'phonenumber'


 Deprecated: Group Table View Background Color is deprecated in iOS 6.0.

Could anyone help me how to fixed it so there wont be any deprecated functions in my project.

Thanks in Advance

回答1:

[self presentModalViewController:pNewController animated:YES];

can be replaced by

[self presentViewController:pNewController animated:YES completion:nil];

The background of this change can be seen on WWDC 2012 video session #236, the evolution of view controllers on iOS.



回答2:

click on the method which is deprecated. in the right column Quick Help inspector you can see the Quick Help from the Apple docs.
There is also a recommandation to use updated or alternate methods.



回答3:

Try this,

Open the .storyboard file or .xib file in "Source Code" mode.

Find and remove this line:

<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>


回答4:

I can help you with the last one: it means that the color GroupTableViewBackgroundColor is no longer supported in ios6. You probably used this in your xib files somewhere.



回答5:

Use like this

[self presentViewController:object animated:YES completion:NULL];

[object dismissViewControllerAnimated:YES completion:NULL];