草庐IT

attempts

全部标签

ios - swift : "Attempt to present UIAlertController whose view is not in the window hierarchy!"

我试图在单击按钮时显示UIAlertController(按钮单击运行特定代码,并根据所述结果显示警报)。初始ViewController是默认的,我创建了第二个(ConsoleViewController)。用户登录,并在成功登录后转到下一个View(ConsoleViewController),该View显示数据(位于ConsoleViewController的viewDidLoad()部分)。用户点击“签到”后,应用程序会捕获设备的GPS位置、当前日期/时间,并打开相机拍摄(自拍)照片。在相机中选择“使用照片”(尚未对该功能进行编码)后,它将所有3个参数发送到API处理程序。第二

ios - 警告 : Attempt to present UIAlertController on UISplitViewController whose view is not in the window hierarchy

这个问题在这里已经有了答案:HowtopresentUIAlertControllerwhennotinaviewcontroller?(39个答案)关闭5年前。大多数与此问题类似的问题是present在viewDidAppear之前被调用。这不是这里的原因。此应用不使用NIB的Storyboard,所有操作都是程序化的。应用程序窗口的rootViewController是一个UISplitViewController。SplitView的ViewController设置为两个UINavigationController的数组。一个subviewController然后模态地呈现一个V

ios - Swift3 Collection View 'attempt to delete item 1 from section 1, but there are only 1 sections before the update'

我的应用程序因“尝试从第1部分删除第1项,但更新前只有1个部分”而崩溃我发现其他文章说数据源必须与collectionView或tableView保持同步,所以我从我的数组中删除了对象:删除我的collectionView中的项目之前的警报,这适用于didSelectItemAtIndexPath。但我不知道为什么这不起作用。我还尝试打印array.count,它显示对象确实从数组中删除了。funcdisableAlarmAfterReceiving(notification:UILocalNotification){foralarminalarms{ifalarm==notifica

ios - SecurityError(DOM 异常 18): Blocked attempt to use history. replaceState()... Angular 5

问题我收到以下错误:[Error]ERROR–Error:Uncaught(inpromise):SecurityError(DOMException18):Blockedattempttousehistory.replaceState()tochangesessionhistoryURLfromfile:///Users//Library/Developer/CoreSimulator/Devices//data/Containers/Bundle/Application//ios-shell.app/public/index.htmltofile:///Users//Library

swift - 警告 : Attempting to access 'myProperty' within its own getter vs SwiftFormat

我有这样的代码:@IBInspectablevarmyProperty:String?{set(newValue){//logicforsetter}get{returnmyProperty}}上面的代码产生了一个警告:Attemptingtoaccess'myProperty'withinitsowngetter.Access'self'explicitlytosilencethiswarning.所以我按照建议修改代码:@IBInspectablevarmyProperty:String?{set(newValue){//logicforsetter}get{returnself.

Swift GRDB 写入数据库错误 "attempt to write a readonly database"

我正在尝试写入我创建的报价数据库。如果用户选择“收藏夹”按钮,它将在SQLITE数据库的收藏夹列中添加一个1(或真)值。由于某种原因,我无法写入数据库,当我执行此代码时:@IBActionfuncaddFavorite(_sender:Any){varconfiguration=Configuration()configuration.readonly=falseletdbPath=Bundle.main.path(forResource:"data",ofType:"db")!letdbQueue=try!DatabaseQueue(path:dbPath,configuration

ios - 警告 : Attempt to present View Controller on * which is already presenting <UISearchController: 0x142a1f7c0>

我用UISearchController和UITableView制作了一个ViewController。您可以从搜索范围按钮中选择两种不同类型的搜索:群组和人员。两种搜索都有效并在表格中显示结果。但是,如果您单击每个单元格,它们应该会将您定向到不同的动态页面(动态组页面或动态个人资料页面)。一个用于组的工作,而一个用于配置文件的不工作。意思是每当我从我得到的结果中点击一个人单元格时,没有任何反应,我在控制台上打印以下警告:Warning:Attempttopresentonwhichisalreadypresenting如果您知道为什么会发生这种情况,请告诉我,我们将不胜感激。编辑:这

ios - "Attempt to delete row from section 1, but there are only 1 sections before update"

我正在尝试删除不符合for循环条件的行。但是,我收到错误消息:“尝试从第1部分删除第0行,但更新前只有1个部分。”我以前从未见过这个,也不确定为什么会收到它。我的代码:functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{letcell=theTableView.dequeueReusableCellWithIdentifier("MyCell")as!TableViewCellcell.titleLabel.text=titles[indexPa

Java hibernate/C3P0 错误 : "Could not obtain connection metadata. An attempt by a client to checkout a Connection has timed out."

我正在尝试获取一些我已通过并运行的代码。它似乎使用了Hibernate框架。我已经克服了大部分调整配置的错误,但这个错误让我难倒了。它正在尝试连接到两个数据库:gameapp和gamelog。两者都存在。它似乎有问题连接到游戏日志,但没有连接到游戏应用程序(稍后在初始化中,它连接并加载其他数据库就好了)。下面,我粘贴了错误和异常堆栈转储。我想象配置中还有其他东西,所以我还包含了该数据库的配置文件。我知道这很含糊,但我希望专业人士能够看到我遗漏的愚蠢错误。org.hibernate.dialect.MySQLDialectcom.mysql.jdbc.Driverjdbc:mysql:/

java.io.IOException : Attempted read from closed stream 异常

我正在使用ApacheHTTP客户端进行HTTPPost调用,然后尝试使用Jackson从响应中创建一个对象。这是我的代码:privatestaticfinalLoggerlog=Logger.getLogger(ReportingAPICall.class);ObjectMappermapper=newObjectMapper();publicvoidmakePublisherApiCall(StringjsonRequest){Stringurl=ReaderUtility.readPropertyFile().getProperty("hosturl");DefaultHttpC