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