首页 \ 问答 \ 选择UICollectionViewCell时以编程方式显示新窗口/视图(Programmatically showing new window/view when selecting UICollectionViewCell)

选择UICollectionViewCell时以编程方式显示新窗口/视图(Programmatically showing new window/view when selecting UICollectionViewCell)

我现在的didSelectItemAtIndexPath代码如下:

- (void)collectionView:(AFIndexedCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
if(collectionView.index == 0){
    NSLog(@"Reordenador contenido por columna %li",indexPath.item);
    self.my_data = [self.my_data  sortByColumn:indexPath.item skip:1 areAllNumbers:TRUE];
    [self.tableView reloadData];
}else{
//show a new window with the content of the cell in a Text Field
    NSLog(@"Row = %li; Column = %li - content = %@",collectionView.index,indexPath.item,[self.my_data objectInRow:collectionView.index column:indexPath.item]);
}   
}

my_data =自定义2D数组类对象

如何以编程方式打开一个新的弹出窗口/新视图,其中包含所选单元格的内容,例如,文本字段和2个按钮 - 保存/取消?


My code right now for didSelectItemAtIndexPath is the following:

- (void)collectionView:(AFIndexedCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
if(collectionView.index == 0){
    NSLog(@"Reordenador contenido por columna %li",indexPath.item);
    self.my_data = [self.my_data  sortByColumn:indexPath.item skip:1 areAllNumbers:TRUE];
    [self.tableView reloadData];
}else{
//show a new window with the content of the cell in a Text Field
    NSLog(@"Row = %li; Column = %li - content = %@",collectionView.index,indexPath.item,[self.my_data objectInRow:collectionView.index column:indexPath.item]);
}   
}

my_data = custom 2D array class object

How would I programmatically open a new popup window / new view with the content of the selected cell inside, for example, a Text Field, and 2 buttons - Save / Cancel?


原文:https://stackoverflow.com/questions/22507274
更新时间:2023-05-05 15:05

最满意答案

请放心,GC会照顾它们。


Rest assured the GC will take care of them.

相关问答

更多
  • addedfile函数不会将文件添加到dropzone.files因此必须手动添加它: // add file - OK var mockFile = { name: 'test.jpg', size: 0, status: 'success' }; docsDropzone.emit( "addedfile", mockFile ); docsDropzone.emit( "thumbnail", mockFile, 'test.jpg' ); docsDropzone.files.push( mockF ...
  • 你究竟想做什么? 假设Text属性是一个字符串,那么据我所知它不能使用格式化程序,因为string不实现IFormattable 。 Binding类(支持DataBindings.Add )具有Format事件和Parse事件,可用于控制格式。 您还可以在目标绑定属性上使用TypeConverter ,我喜欢它,因为它将此逻辑移离UI。 所以:你有一个你想做的例子吗? What exactly are you trying to do? Assuming the Text property is a st ...
  • 下面的代码示例演示如何将对象集合绑定到DataGridView控件,以便每个对象显示为单独的行。 如何:将对象绑定到Windows窗体DataGridView控件 在C#中使用DataGridView的ComboBox The following code example demonstrates how to bind a collection of objects to a DataGridView control so that each object displays as a separate r ...
  • 将Pod集成到项目中时,CocoaPods会生成无法从Xcode轻松修改的库。 如果你有CocoaPods构建框架,那么根本就不能修改它们。 您通常必须重新运行pod install或pod update以便在将文件添加到Pod时让CocoaPods重新生成它们。 如果你想要可靠地将文件添加到Pod中,你应该在你的机器上签出一个副本,不在你项目的文件夹中,并使用类似下面的内容告诉CocoaPods那个Pod是你正在开发的那个,因此应该以不同的方式集成: pod MyPod, :path => 'path/t ...
  • 请放心,GC会照顾它们。 Rest assured the GC will take care of them.
  • 您可以将数据放在另一个实现INotifyPropertyChanged的类中,以便通知和更新UI: public partial class Form1 : Form { DataClass dc; public Form1() { InitializeComponent(); dc = new DataClass(); label1.DataBindings.Add("Text", dc, "X", true, DataSourceU ...
  • 显然,更新数据源上的任何值都将导致更新所有绑定。 这解释了行为(设置myClass.Text1会导致textBox2使用myClass.Text2的当前值进行更新)。 不幸的是,我能够找到的几篇文章只是说,“这就是它的工作原理”。 处理此问题的一种方法是创建BindingSource ,设置BindingSource.DataSource = myClass ,然后将TextBox绑定到BindingSource 。 如果基础数据源是列表并且添加,删除项目等, 或者 DataSource属性发生更改,则Bi ...
  • 尝试指定DataSourceUpdateMode : Dim idBinding As New Binding("Text", bindSource, idField.Name, _ False, DataSourceUpdateMode.Never) 从DataSourceUpdateMode枚举 : 决不: 数据源永远不会更新,并且不会解析,验证或重新格式化输入到控件中的值。 您可以直接更改此内容: idBinding.DataSourceUp ...
  • 你不能。 要实现此目的,您需要以编程方式使用push()方法。 此方法将生成一个唯一键,该键可以保存在数据库中,稍后在项目中使用。 请参阅有关将数据保存到Firebase数据库的官方文档 。 希望能帮助到你。 No, you cannot. To achieve this, you need to use the push() method programmatically. This method will generate a unique key that can be saved in your d ...
  • style属性无法检索UIBarButtonSystemItemTrash 。 style是UIBarButtonItemStyle类型,可以是UIBarButtonItemStylePlain , UIBarButtonItemStyleBordered 请查看此处的文档 使用此代码 @property (strong, nonatomic) IBOutlet UINavigationBar *RibbonDetailNavBar; // No need to create rightBarButtonI ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)