【错误信息】
真机调试时出现如下错误:
Code Signing Error
Signing for "*****" requires a development team.Select a development team in the project editor.
Code signing is required for product for product type 'Application' in SDK 'IOS 11.0'
原因及解决办法:
navigate to General -> Device Management, then select your Developer App certificate to trust it.
原因及解决办法:2017-11-01 22:41:40.360911+0800 01-切换文字颜色-第一个iOS程序[1119:49204] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[
【错误信息】
网上的开源项目下载下来真机调试
Code Signing Error: Failed to create provisioning profile. The app ID "com.cloudling.Masonry-iOS-Examples" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
Code Signing Error: No profiles for 'com.cloudling.Masonry-iOS-Examples' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.cloudling.Masonry-iOS-Examples'.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'
分析原因:由于第一次连接MAC时,在设备上点击了"不信任"选项,所以XCode 8不能访问手机,所以才出现这个问题.。
解决办法:Apple官网的解释:https://support.apple.com/en-us/HT202778
点击 设置 --> 通用 --> 重置 --> 重置位置和隐私 ,然后关闭xcode 8, 拔掉数据线,重启xocde 8开启项目, 重新插上数据线,此时手机上会显示mac与手机设备的连接访问权限,选择“信任”即可。
chmod: iOS: No such file or directory
chmod a+x Pods-Masonry\ iOS\ Examples-resources.sh;
UITableViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:ID];
cell.textLabel.text = [NSStringstringWithFormat:@"cell - %zd", indexPath.row];
return cell;
【错误信息】
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView (
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView (
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView (
FBQuestionSaveViewController *save = [[FBQuestionSaveViewController alloc] init];
// 导航控制器调用push,跳转到保存问卷的界面
[self.navigationController pushViewController:save animated:YES];
正确的应该用如下方式创建storyboard已经生成好的viewcontroller
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UITableViewController *save = [storyboard instantiateViewControllerWithIdentifier:@"QuestionSaveViewController"];
[self.navigationController pushViewController:save animated:YES];
if([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
// 如果tableView响应了setSeparatorInset: 这个方法,我们就将tableView分割线的内边距设为0.
[self.tableView setSeparatorInset:UIEdgeInsetsZero];
}
if([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
// 如果tableView响应了setLayoutMargins: 这个方法,我们就将tableView分割线的间距距设为0.
[self.tableView setLayoutMargins:UIEdgeInsetsZero];
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
// 这两句的含义跟上面两句代码相同,就不做解释了
if([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
原因及解决办法:
账号被注销,需要重新登录一下
I had to go to "Preferences" -> "Accounts", where it turned out my Apple ID had timed-out. After logging-in there, and then restarting Xcode, my profile was automatically "repaired", and all is now well.iOS9引入了新特性App Transport Security (ATS)
新特性要求App内访问的网络必须使用HTTPS协议。
NSAppTransportSecurity
类型Dictionary
。NSAppTransportSecurity
下添加NSAllowsArbitraryLoads
类型Boolean
,值设为YES
【错误信息】
IOS警告函数头 used as the name of the previous parameter rather than as part of the selector
原因及解决办法:
多为传入多个变量没有空格引起,在第二变量的冒号前面加个空格既可以解决。
【错误信息】
使用真机Iphone5s调试时,在UIView上面添加UIScrollView,并在UIScrollView上动态添加控件,但是出现第一次显示的时候控件会出现被截掉了显示不全的问题,布局的右宽度用的是UIScrollView宽度
原因及解决办法:
//始终是320
//CGFloat l = [[UIScreen mainScreen] bounds].size.width;
//第一次是600,后面一直是320
//CGFloat m = self.view.frame.size.width;
//第一次是375,后面一直是320
//CGFloat t = self.scrollview.frame.size.width;
如上所述,使用UIScrollView宽度会出现变化的问题,使用[[UIScreen mainScreen] bounds]可以解决
作者:水煮鱼
出处:http://blog.csdn.net/panfb227