iOS 问题收集及处理 (弃用方法收集)持续更新中(warning,errors)

11 篇文章 0 订阅
10 篇文章 0 订阅
  • 1.warning
  • 2.errors
  • 3.真机运行

warning:(报黄⚠️)

1.CGSize sz = [message sizeWithFont:ft constrainedToSize:CGSizeMake(250, 1000)];

2.NSArray*ifs = (__bridgeid)CNCopySupportedInterfaces();
id info = nil;

for (NSString *ifnam in ifs) {

    info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);

    if (info && [info count]) {

        break;

    }

}
3.constrainedToSize

CGSize sz = [message sizeWithFont:ft constrainedToSize:CGSizeMake(250, 1000)];
alertView 弃用 (UIAlertController 代替)

4. ABPeoplePickerNavigationController iOS 9.0之后弃用

这里写图片描述

代替方案:
引用—–>

#import <ContactsUI/CNContactViewController.h>
#import <ContactsUI/CNContactPickerViewController.h>

这里写图片描述

5.stringByAddingPercentEscapesUsingEncoding iOS9.0后弃用
NSString *str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

这里写图片描述

解决方案:

    NSString *string = @"hahahaha";
    NSString *Urlstring = [string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLUserAllowedCharacterSet]];

这里写图片描述

6.UIAlertView (iOS9.0后弃用)
 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
    [alert show];

同时弃用的还有 UIActionSheet (iOS 8.3 后弃用)

 UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"收款" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"保存", nil];
    actionSheet.tag = 105;
    [actionSheet showInView:self.view];

这里写图片描述

7.interfaceOrientation (iOS8.0后弃用)
    UIInterfaceOrientation toInterfaceOrientation = self.interfaceOrientation;

    if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
        [self remasMakeForVertical];
    }else{
        [self remasMakeForLandscape];

    }

这里写图片描述

8.applicationFrame(iOS 9.0 后弃用)
screenshotImgView.frame = [UIScreen mainScreen].applicationFrame;

这里写图片描述

————–分割————–

errors:(报红)

真机调试问题

1.launchscreen 黑屏问题

可能原因: 真机运行内存较小,launchscreen图片过大
解决方法: 删除掉原先的launch screen 重新建立一个launchscreen.storyBoard (iOS 8.0以下 位launchscreen.xib) 重新建立后运行成功.
希望有哪位大神可以解释下原因.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值