在Xcode Storyboard中使用Unwind Segue关闭Popover(Dismiss Popover using Unwind Segue in Xcode Storyboard)
我正在使用Xcode 4.5和新的iOS 6功能来展开segues。 我在弹出窗口中呈现导航视图控制器,该控制器以编程方式从条形按钮项目呈现:
- (IBAction)configChartTapped:(id)sender { if (self.popover.isPopoverVisible) { [self.popover dismissPopoverAnimated:YES]; } else { UINavigationController *chartConfigNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"GrowthChartNavigationController"]; ConfigChartTypeViewController *configChartTypeViewController = (ConfigChartTypeViewController*) chartConfigNavigationController.topViewController; self.popover = [[UIPopoverController alloc]initWithContentViewController:chartConfigNavigationController]; self.popover.popoverContentSize = CGSizeMake(320, 500); self.popover.delegate = self; [self.popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } }
在这个方法旁边,我已经定义了一个目标来展开segue(即解雇popover)......
- (IBAction)cancelConfig:(UIStoryboardSegue *)segue { // }
...并将其连接到导航视图控制器导航栏中的取消按钮。
将取消栏按钮连接到cancelConfig按钮在Xcode中正常工作。
但是,在运行代码时,单击“取消”按钮时没有任何反应,尽管Xcode 4.5应该支持在展开segues时解除弹出窗口(根据发布文档)。
我错过了什么?
谢谢!
I am using Xcode 4.5 and the new iOS 6 feature to unwind segues. I am presenting a navigation view controller inside a popover which is presented programmatically from a bar button item:
- (IBAction)configChartTapped:(id)sender { if (self.popover.isPopoverVisible) { [self.popover dismissPopoverAnimated:YES]; } else { UINavigationController *chartConfigNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"GrowthChartNavigationController"]; ConfigChartTypeViewController *configChartTypeViewController = (ConfigChartTypeViewController*) chartConfigNavigationController.topViewController; self.popover = [[UIPopoverController alloc]initWithContentViewController:chartConfigNavigationController]; self.popover.popoverContentSize = CGSizeMake(320, 500); self.popover.delegate = self; [self.popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } }
Next to this method I have defined a target to unwind the segue (i.e. dismissing the popover)...
- (IBAction)cancelConfig:(UIStoryboardSegue *)segue { // }
... and connected it to a cancel button in the navigation view controllers's navigation bar.
Connecting the cancel bar button to the cancelConfig button worked fine in Xcode.
However, when running the code, nothing happens when clicking on the Cancel button despite Xcode 4.5 should be supporting dismissing popovers when unwinding segues (according to the release docs).
What did I miss?
Thank you!
原文:https://stackoverflow.com/questions/13457296
最满意答案
这取决于,如果你有ssh访问服务器,是的,只需在服务器上创建git repo然后在本地拉它然后
git push
,你将不得不在服务器上创建一个git hook来自动“checkout”最新的更改。服务器:
cd /var/www/site.com git init git add -A git commit -a -m 'initial' cd .git echo "#!/bin/sh" > hooks/post-receive echo "git checkout -f" >> hooks/post-receive chmod +x hooks/post-receive
当地的:
git clone user@host:/var/www/site.com cd site.com --edit stuff-- git commit git push
That depends, if you have ssh access to the server, yes, just create the git repo on the server then pull it locally and then
git push
, you will have to create a git hook on the server to auto "checkout" the latest changes.server :
cd /var/www/site.com git init git add -A git commit -a -m 'initial' cd .git echo "#!/bin/sh" > hooks/post-receive echo "git checkout -f" >> hooks/post-receive chmod +x hooks/post-receive
local :
git clone user@host:/var/www/site.com cd site.com --edit stuff-- git commit git push
相关问答
更多-
正如OP btype 评论 : 它是gitolite和git-account混合使用不起作用,但缺失的.pub是失败的。 因此需要在gitolite-admin/keys repo中添加ssh密钥并将其推送到gitolite服务器,这将把该密钥添加到~git/.ssh/authorized_keys文件中。 请参阅“ 像gitolite这样的程序如何工作? ” 如果该过程未正确完成,则对该服务器的任何git命令(推/拉/克隆)都会要求输入密码。 As the OP btype comments: it wa ...
-
我认为你需要(重新)仔细阅读文档 ,这些是GIT的基础知识。 基本上,就目前而言,您已经创建了一个空存储库并添加了1个空文件。 但是......这个修改(添加文件)尚未提交! 这就是为什么当您克隆回购时它不会出现在您的PC上。 我正在为同一个puprose使用GIT:我在本地网络上的raspberryPi上编辑/测试代码,并在验证时将更改推送到服务器。 这是工作流程。 存储库在服务器上的/ home / me / gitrepos中创建。 这是'起源'遥控器和'主'分支。 我在我的电脑上和服务器上的网络服务 ...
-
所以事实证明我正在安装的Wamp / Xampp版本(这是新版本)有php版本,它与bluehost服务器(当前为5.2.17)的php版本不兼容。 所以我安装了Xampp 1.7.1版(支持php 5.2.8版)。 现在我的本地工作正如我的服务器一样......一切都在显示它应该! So it turns out that the Wamp/Xampp version I was installing (which were the new versions) had php versions which ...
-
您可以在生产目录中初始化新的存储库,但如果出现任何问题,可能会搞砸生产服务器。 相反,在生产目录上尽可能少地工作。 首先确保存储库与生产中的存储库具有相同的内容是最简单和最安全的。 回购新品。 将所有生产文件复制到那里。 筛选任何差异并酌情提交。 推。 一旦完成,我们现在知道生产具有与回购中相同的文件。 您只需移动.git目录,而不是移动整个生产目录。 配置服务器以拒绝.git/服务文件 将.git/从克隆复制到生产目录。 使用生产目录中的git status验证一切正常。 You could initia ...
-
git存储库包含有关.git文件夹中文件的所有信息,因此当您删除它时,将删除有关内部存储库文件的所有信息。 文件本身没有改变,但外部回购不知道它们,因为它从来没有。 知道他们的是内部回购,而现在已经不存在了。 你需要git add和git commit它们。 Found the answer, finally. git rm --cached path/to/submodule (no / or * at the end) I haven't added these repos as submodules ...
-
对于初学者,如果您在团队中,则分叉您正在处理的存储库。 您在fork上完成的所有更改都会提交到您的仓库,尽可能多地提交,因为这是您的仓库。 在此处使用本地主机并添加功能和设置,验证它们是否有效。 准备就绪时,请对主仓库进行任何更改然后合并到您的仓库,通常在此时如果您的设置不同而您忘记将本地主机设置更改回常规,git会标记它并要求您解决将其与master进行比较的冲突。 解决冲突然后合并它们。 重复Master,这样它们是相同的。 一般来说,如果你在一个小组中,你们都不应该不小心与主分支一起工作,因为它应该保 ...
-
您应该查看git-receive-pack以获取有关安装挂钩的信息,这些挂钩在您推送到存储库时会触发。 有关脚本的一些示例,请参阅Git Book ,这些脚本可以在推送后为您结算。 You should look at git-receive-pack for information on installing hooks which are triggered when you push to a repository. See Git Book for some examples of scripts ...
-
如何使用git在localhost和server之间复制文件?(How can I copy files between localhost and server using git?)[2023-08-31]
这取决于,如果你有ssh访问服务器,是的,只需在服务器上创建git repo然后在本地拉它然后git push ,你将不得不在服务器上创建一个git hook来自动“checkout”最新的更改。 服务器: cd /var/www/site.com git init git add -A git commit -a -m 'initial' cd .git echo "#!/bin/sh" > hooks/post-receive echo "git checkout -f" >> hooks/post-r ... -
什么是git服务器?(What exactly is a git server?)[2022-06-14]
遥控器可能只是Windows服务器上映射网络驱动器内的文件夹吗? 我想知道因为我看到了一系列与遥控器连接的选项,包括本地文件。 是的,它可以像本地文件夹一样简单。 当然,如果您不需要任何身份验证或授权。 我想我的问题归结为,是否有git服务器必须处理的特殊git协议,或者它真的只是一种服务构成存储库的文件的方法? HTTP上有两个协议,SSH上有另一个协议。 我相信HTTP协议只对所有人都是只读的,没有授权,但我不记得了。 SSH协议是在SSH访问的任何计算机上设置git服务器的简便方法。 在下面,每次调用 ... -
这样你就可以替换完全没有改变的文件。 在这种情况下使用rsync会更好。 如果您真的想使用ruby,请参阅rsync备份或此rsync gem This way you will replace files that haven't changed at all. Would be better to use rsync in this case. See rsync backup or this rsync gem if you really want to use ruby