- 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) 重新建立后运行成功.
希望有哪位大神可以解释下原因.