IOS开发过程常见警告解决方案归纳总结

来源:互联网 发布:java类库是什么 编辑:程序博客网 时间:2024/06/05 07:52

1.        'UITextAlignmentCenter' isdeprecated: first deprecated in iOS 6.0

UITextAlignmentCenter改成NSTextAlignmentCenter,就不会出现这个提示了。而且一样是居中显示。

 

2.        modal segues are deprecated inios

这两个方法被废弃了,我们需要找到合适的方法来代替,这时候我们发现 showPresent Modally方法,这个一般可以满足我们的使用要求。

 

3.      unsupported configuration plain styleunsupported in a navigation item

IB上,如果你在bar button Item上添加了Round Rect Button 可能会出现这个错误,这是需要将 BarbuttonItem设置成:Bordered

 

4.      Minimum Font Size deprecated on ios version 6.0

An Alternative to the minimumFontSize isminimumScaleFactor. If you assign minimumFontSize/defaultFontSize tominimumScaleFactor, it works in the same way as minimumFontSize.

 

5.      修改JSONKit中的isa警告

在使用jsonkit时出现一个关于isa的警告,警告为:Direct access to objective-c`s isa is deprecated in favor ofobject_setClass() and object_getClass()。直接使用isa是被弃用的方法,推荐使用object_setClass()object_getClass()方法。如果要去掉这里的两个警告,我们只需要改为object_setClass(dictionary,_JKDictionaryClass)就可以了。

 

6.      Bitmasking for introspection of Objective-Cobject pointers i

某数字" & 0x1的时候,代表取最低位,改成:

 

BOOL  workAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteger)object) %2))  ? YES  : NO;即可。

 

7.      'isa' is deprecated

直接使用isa是被弃用的方法,推荐使用object_setClass()object_getClass()方法。如果要去掉这里的两个警告,我们只需要改为object_setClass(dictionary, _JKDictionaryClass)就可以了。

1 0
原创粉丝点击