做的是二维码扫描,扫描后识别为URL的话就跳转到webview 加载网页,用的是代理传值的方式.扫描到了 值传递到主页 扫描窗体退出,检测值是否是http://开头 是网页就跳转. 问题出在传值到主界面后判断网页链接再跳转的时候 出现Attempt to present on whose view is not in the window hierarchy的错误,也就是传值回去的时候主视图还没打开又要打开浏览视图 然后就乱掉了 不知道要打开啥了. 尝试诸多方法之后找到以下方法: 在扫描结果之后…
当我想从一个VC跳转到另一个VC的时候,一般会用 - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion;当然也可以用导航push. 有时会遇到了此类警告:Warning: Attempt to present on whose view is not in the window hier…
系统:mac OS  10.12 (16A323) Xcod:8.3.3 错误:Warning: Attempt to present <UIAlertController: 0x7fd192806e20> on <ViewController: 0x7fd1928048d0> whose view is not in the window hierarchy! 原因:今天写UIalerCortoller 出现此错误,查找得资料这是个经典的 错误,在往后日子里面都会遇到类似问题,这…
当 storyboard里面的 按钮 即连接了 类文件里面的点击方法  又  连接了   storyboard里 另一个  控制器的  modal 就会出现类似Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!的错误  ,意思是说系统尝试present一个没有在wi…
昨天写豆瓣发广播Demo的时候,为了写Demo的简单,就使用了Storyboard,结果执行视图跳转时遇到了这个问题: Warning: Attempt to present <UINavigationController: 0x8d514e0> on <OAuthViewController: 0xa044a60> whose view is not in the window hierarchy! 其功能是OAuthViewController用于用户授权,在获取用户的授权后将…
问题现象:想在页面初始化的时候,使用self.presentViewController方法弹出个告警提示框UIAlertController.但行后报了个如下告警,同时告警框也出不来. 1 2015-03-10 09:55:34.197 Test[1140:29622] Warning: Attempt to present <UIAlertController: 0x7c95ca20> on <Test.ViewController: 0x7a6afc60> whose vie…
错误分析:            controller A present controller B ,前提是A的view要存在,如果不存在,就会报这个错.   解决方法:             将原来的present语句由 viewDidLoad方法中移到 viewDidAppear中,问题就可以解决.但是这样的话,画面会闪现一下parentViewController的view,这个问题目前不清楚怎么解决,有待高人指点. 并且viewDidAppear这个方法是每次都进入,和ViewDid…
附:前端常见跨域解决方案(全) 跨域错误 解决方法 在后台写一个过滤器来改写请求头 附上一个前端不知所以然的后台java代码: public class CorsFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest servletRequest…
在给 tableViewCell 添加长按手势弹出一个 popViewController 的时候,遇到的这个变态问题: Warning: Attempt to present <UINavigationController: 0x15f259c00>  on <RepoDetailViewController: 0x160271400> which is already presenting (null) 我的solution : 不使用手势去运行此方法.换用了button的ad…
Warning: Attempt to present (要被presented的控制器)  on (哪个控制器来presenting) which is already presenting (已经被presenting的控制器) self: 是被presented出来的控制器, self.presentingViewController: 看看是谁把self给presenting出来 RPLog(@"%@ - %@", self.presentingViewController,…
1, Swift 修改导航栏颜色 self.navigationController?.navigationBar.barTintColor 2, Swift button 属性设置时直接进行初始化 var leftButton : UIButton = UIButton(type: UIButtonType.Custom) 由于是read-only属性, 所以不可以后修改, 直接在初始化的时候设置. Type不推荐用system, 会自动渲染成蓝色. button添加触发方法只需要在actio…
swift关于字符串的推断中 有前导.有后缀 两个方法.竟然没有包括推断. 经过学习找了个简单的解决方法: extension String { func has(v:String)->Bool { return self.componentsSeparatedByString(v).count > 1 } }…
首先我遇到的问题是这样的: 我之前封装的OC类,我导入现在的swift工程中,然后建立桥接文件,在Swift的控制器中可以找到这个OC写的东西. 但是问题来了,当你使用cocoapods导入的OC三方类,swift里面却找不到这个头文件,很是吓JB扯淡的.遇到这些问题真的很少脑筋!还好通过查找资料解决了! 以下是解决方法,希望对大家有帮助 第一步:选择Target -> Build Settings 菜单 第二步:在All ->Search Paths下面找到 \”User Header Se…
Ubuntu14.04 panic --not syncing: Attempt to kill init 解决方法 工作电脑装了一个虚拟机玩玩,胡乱下载了一些软件,apt-get了不少操作,后来重启就发生了上述异常,当时就蒙蔽了,百度到通过启动的时候选择advanced options for ubuntu选择Linux-4.4.0-31-generic启动成功,后来不了了之. 今天有空就来研究一下,百度了一番方法基本都是这样: https://www.cnblogs.com/xym4869/…
出现这种情况,例如:我在获取相册图片后,直接present到另一个页面,但是上一个页面可能还未dismiss,所以,要在获取相册图片的dismiss方法的complete的block里面写获取图片及跳转的方法!!!…
解决方法: /* I think this is because in iOS 8, alert views and action sheets are actually presented view controllers (UIAlertController). So, if you're presenting a new view controller in response to an action from the UIAlertView, it's being presented w…
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) //显示navbar self.navigationController?.setNavigationBarHidden(false, animated: true) if(isBeingPresented || isMovingToParent){ print("======push") }else{ print("…
由于Swift编程语言属于上层编程语言,而Swift中由于为了低层的高性能计算接口,所以往往需要C语言中的指针类型,由此,在Swift编程语言刚诞生的时候就有了UnsafePointer与UnsafeMutablePointer类型,分别对应为const Type*类型与Type *类型. 而在Swift编程语言中,由于一般数组(Array)对象都无法直接用于C语言中含有指针类型的函数参数(比如:void*),所以往往需要将数组转为指针类型,此外也需要将数组中元素内容存放到连续的存储空间.此外,…
Bringing up interface eth0:  Device eth0 does not seem to be present, delaying initialization. 在linux下的虚拟机出现了这个问题,原因是要修改固定ip,作了部分修改. 故障现象:[root@host2~]# service network restart Shutting down loopback insterface:                                      …
在安卓4.4.2的关于蓝牙开发的一个sample BluetoothChat中,调试时,老是出错:Attempt to invoke virtual method 'void android.app.ActionBar.setTitle 上网查了一下,是这么说的: (http://www.tuicool.com/articles/IRzUR3M) The LayoutManager is probably the most interesting part of theRecyclerView …
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs.com/strengthen/)➤GitHub地址:https://github.com/strengthen/LeetCode➤原文地址:https://www.cnblogs.com/strengthen/p/10246820.html ➤如果链接不是山青咏芝的博客园地址,则可能是爬取作者的文章…
其实根据常用的webservice清除缓存方法,在client端加入这样一句话: ini_set("soap.wsdl_cache_enabled", "0"); 应该就可以了,但是处理了好久,在本地测试没问题,放到服务器上就不行,一直提示:Procedure 'getSent' not present 后来查看PHP的配置文件php.ini,找到这样一句话: soap.wsdl_cache_dir="/tmp" 然后进入对应目录,看到有这样子的…
(未经同意,不得转载!) ------------------------华丽分割线-----------------------…
在app中的build.gradle中加入如下代码, configurations { all*.exclude group: 'com.google.code.gson' all*.exclude group: 'com.squareup.okhttp3' all*.exclude group: 'com.squareup.okio' all*.exclude group: 'com.android.support',module:'support-v13' } 如图…
今天出现了一个问题找了好久先看代码: 这可能是个BUG吧插入代码: dataType: 'jsonp', crossDomain: true, 最终:…
1. init(coder:) 它是视图控制器从故事板创建实例的默认初始化函数.(It is the initializer for UIViewController instances created from a storyboard.) 它在整个生命周期中只被调用1次. 2. init(nibName:bundle:) 它是视图控制器的指定初始化函数. (It is the designated initializer for UIViewController.) 当视图控制器的实例不是通…
将sqlite数据库文件,设置为users完全控制.重启网站即可!…
使用VirtualBox复制一份CentOS后重新设置了网卡地址,导致启动网络服务出现下图错误 解决方案 执行命令,查看/etc/udev/rules.d/70-persistent-net.rules文件内容,记录下eth1的信息 -persistent-net.rules 然后执行如下命令,修改红圈部分为上图内容 重启网络服务即可 service network restart 此时服务启动正常.…
1.删除文件: /etc/udev/rules.d/70-persistent-net.rules 2.编辑 /etc/sysconfig/network-scripts/ifcfg-eth0 删除HWADDR(MAC) 3.虚拟机生成一个全新MAC *4.一定要重启 我猜测可能是mac冲突造成,我的这个虚拟机是克隆出来的,所以可能是和原来的mac冲突导致获取不到IP.…
1:IOS开发基础知识--碎片1 a:NSString与NSInteger的互换 b:Objective-c中集合里面不能存放基础类型,比如int string float等,只能把它们转化成对象才可以存放,就是类NSNumber c:NSDATA与NSString互转 d:去除输入框空格(NSString也适用) f:IBOutlet,IBAction说明 2:IOS开发基础知识--碎片2  a:获得另一个控件器,并实现跳转 b:判断IOS版本 c:Button不同状态下背景图片 d:判断设备…