一、-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "WebViewController" nib but the view outlet was not set.'
注 : 这个错误一般是把xib文件删了之后,后面有自己创建了一个xib会遇到的。
解决步骤:
1, 打开xib文件
2, 点击"File‘s Owner",设置Class为xxxViewControler
3, 右键"Files‘s Owner", 里面有个默认的IBOutlet变量view, 看一下后面有没有做关联,如果没有就拉到下面的View和视图做个关联
二、用xib自定义UIColletionViewCell注意在下面方法里面加上两句话(加一点颜色,会更醒目一些,这个是在csdn一位朋友那看到的,敲在这里,也帮助自己记住一下)
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
// 1.注册xib
UINib *nib = [UINibnibWithNibName:@"ClassifyCollectionCell"
bundle: [NSBundlemainBundle]];
[collectionView registerNib:nibforCellWithReuseIdentifier:@"ClassifyCollectionCell"];
ClassifyCollectionCell *cell = [[ClassifyCollectionCellalloc]init];
// 2.设置重用标识符
cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ClassifyCollectionCell"forIndexPath:indexPath];
}
三、You don’t have permission
1. 确保youRoot文件夹下有index.html文件(或名为index而后缀为其他形式(如.jsp .php等)的文件),因为Apache默认以index.html为网站首页,如果没有这个文件就会出现上面的403错误。
2.直接clean一下(这个当时想了很多解决方法,最后clean一下,重启xcode竟然就好了)。
四。[__NSCFDictionary bytes]: unrecognized selector sent to instance 0x7fbcb3495cf0
把字典当NSData用了,解析过来就是NSDictionary,不用在解析一遍了.
五。iOS模拟器怎么输入中文
模拟器默认的配置种没有“小地球”,只能输入英文。加入中文方法如下:
找到模拟器的Settings--->General-->Keyboard-->International KeyBoards-->Add New Keyboard-->Chinese Simplified(PinYin)即我们一般用的简体中文拼音输入法,配置好后,再输入文字时,点击弹出键盘上的“小地球”就可以输入中文了。
六、/Users/qianfeng/Desktop/UI作业/MangoTV/MangoTV/NetWorking(下载数据)/AFNetworking/AFURLRequestSerialization.m:314
2015-06-26 22:09:23.808 MangoTV[9664:250462] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: URLString'
问题:url的问题,看是不是删了参数
后面找到的原因:在url删了一个参数,就会报错
解决方法:直接在接口里面找
七、如果在使用collectionView时,遇到下面的问题,该这样解决
当你想要两张图片对称显示,但是怎么设置上左下右UIEdgeInsetsMake都没用,那你去检查一下自定义xib的适配有没有问题,把适配改一下就ok了
八、如果代理调不过来方法,那就打印一下代理是不是空,如果是那就是没有赋值,去控制器加上:XXX.delegate = self;
九、怎么进行格式对齐,就是写了if之后 有可能要删,要对其上下文,快捷键是: command+[
十、只让播放视频的时候能够全屏,其他全部非全屏非横屏。方法:切在appdelegate里面
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if ([NSStringFromClass([[[windowsubviews]lastObject]class]) isEqualToString:@"UITransitionView"]) {
returnUIInterfaceOrientationMaskAll;
//优酷土豆 乐视 已经测试可以
}
returnUIInterfaceOrientationMaskPortrait;
}