首页 \ 问答 \ 在Xcode Storyboard中使用Unwind Segue关闭Popover(Dismiss Popover using Unwind Segue in Xcode Storyboard)

在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
更新时间:2022-03-06 14:03

最满意答案

这取决于,如果你有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 ...
  • 这取决于,如果你有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 ...
  • 遥控器可能只是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

相关文章

更多

最新问答

更多
  • 您如何使用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)