问题标签 [setediting]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
282 浏览

ios - EXC_BAD_ACCESS (SIGSEGV) 由于 table setEditing

我遇到了一个问题,导致我的代码在 iOS 8 上崩溃。它在 iOS 7 上运行良好,但由于某些奇怪的原因在 iOS 8 上崩溃。我已经调试了代码,直到我发现它在哪里崩溃......这是它崩溃的函数:

它崩溃:

这是日志:

这是崩溃报告:https ://ghostbin.com/paste/2sq95

它表明当 dylib 中的 0x1654 处的代码运行时应用程序崩溃。但是当我在 IDA 中查看时,我发现:

这个函数根本没有任何外部参照!它也不是初始化程序,导致代码正确初始化...任何帮助将不胜感激...为什么:[tableView setEditing:YES animated:YES]; 在 iOS 8 而不是 iOS 7 上导致崩溃 Oo 这个错误让我抓狂。

0 投票
0 回答
178 浏览

ios - 返回按钮隐藏时闪烁

当视图控制器进入编辑模式时,我试图隐藏后退按钮。

这是代码

它在纵向模式下工作正常。(对不起,大图。)

显示返回按钮

隐藏返回按钮

问题发生在横向模式下。每次退出编辑模式时,后退按钮都会快速显示和隐藏。奇怪的是后退按钮就在显示模式按钮的后面。

返回按钮闪烁

我正在使用 Xcode7 beta3 和 iOS9 模拟器。Apple 提供的示例代码“Lister”以相同的方式实现了此功能并且工作正常,但我找不到任何区别。有人帮忙吗?

0 投票
0 回答
133 浏览

ios - 从 setEdit 上的 UITableViewCell 中删除剩余空间:YES

我有tableView一些用户可以重新排序的问题,所以我将属性设置setEditingYES

[questionTableView setEditing:YES animated:YES];

我也不希望我的用户删除任何既不添加的行,所以我在其委托函数中返回了UITableViewEdtitingStyleto 。UITableViewCellEditingStyleNone;

但是,单元格左侧有很多空间需要删除。我怎样才能做到这一点 ? 在此处输入图像描述

0 投票
1 回答
126 浏览

swift - What is the actual meaning of " ! " prefix in Swift?

I want to know about prefix !. I have created an app, and it has tableView. And I have used setEditing:animated property for editing a tableView, it allows multiple selection. When user start selecting? We need to cancel segue operations. Of course we need to override shouldPerformSegueWithIdentifier method. Here's my code

Firstly I've tried to use return editing. Xcode does not gave me any errors even run time errors. Everything seems to works just fine. But segues are still works. And then I've tried to use with prefix return !editing. Works perfect! What's the actual meaning of this prefix ! ?

Thanks

0 投票
3 回答
854 浏览

ios - editButtonItem 不会更改编辑/完成标题

我在这里使用默认的 Bar Button Item editButtonItem:

但是,它不会将按钮的标题从 Edit 更改为 Done。我知道,它可以自动更改,不想像这样分配它: self.editButtonItem.title = @"Done";

0 投票
1 回答
1005 浏览

ios - 如何将 setEditing 状态转换为 Edit/Done 按钮的切换模式

I am using a Edit/Done button to move an MKMapView upwards when Edit mode is selected, with the intention of display a message in an imageView at the bottom of the screen. 我的理解是改变这个按钮的功能我必须使用override func setEditing()。

虽然我可以让它从编辑模式更改为完成模式一次,但随着相应的标题更改,我永远无法将其更改回编辑模式。结果是当您一遍又一遍地按“完成”时,它仍然是“完成”并继续向上移动 MKMapView。

我希望它作为切换操作,但由于某种原因,该过程使我无法理解:

我在 if/else 语句中尝试实现的“isEditing”和“isEnabled”到目前为止还没有奏效。我错过了什么?

编辑:

好吧,我想出了这种方法,虽然可行,但看起来很笨拙。

我必须使用 64 作为值来让 mapView 返回到超级视图的底部,但不完全确定为什么。

中心视图控制器是有问题的

0 投票
1 回答
86 浏览

ios - 如何为所有单元格启用编辑模式,而不仅仅是可见单元格

在我的应用程序中,我想允许用户按下一个按钮,使他们能够更改表格视图单元格的顺序。

我在用 [tableView setEditing:YES animated:YES];

但是,当用户按下按钮然后滚动时,按下按钮时不可见的单元格没有启用编辑模式。

我在 Apple 的文档中读到:“当您在编辑值设置为 true 的情况下调用此方法时,表格视图会通过在每个可见UITableViewCell 对象上调用 setEditing(_:animated:) 进入编辑模式。”

有没有办法让所有单元格都处于编辑模式,尽管在启用编辑模式时不可见?

以下是一些快照:

启用编辑模式后

滚动后

0 投票
1 回答
53 浏览

ios - self.editing 与 self.tableView.editing 和 setEditing 的混淆

在编辑打开时在我的 UITableView 控制器上呈现模态视图后,我发现控制器关闭时self.editing和的值self.tableView.editing不同(self.editing仍然打开但self.tableView.editing已关闭并且 tableView 处于奇怪状态)。

为了纠正这个问题,我 [self setEditing:NO animated:YES]在展示模态视图时做了。

我发现这两行不做同样的事情:

我的问题是:

(1)为什么这些命令和

(2)self.editing和的状态如何self.tableView.editing不同?