小编Leo*_*hty的帖子

dismissModalViewControllerAnimated适用于self但不适用于parentViewController

我得到dismissModalViewControllerAnimated在以下设置上正常工作但我很困惑为什么它适用于self(modalViewController)而不是parentViewController.

这是设置:

  1. 我有一个UITableViewController,带有一个调用模态视图的导航按钮:


    - (void)viewDidLoad
    {
        [super viewDidLoad];
        self.title = @"Root";

        _data = [NSArray arrayWithObjects:@"One", @"Two", nil];
        _detailController = [[DetailViewController alloc] init];

        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;

        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(showAbout)];
    }

    - (void)showAbout
    {
        AboutViewController *abv = [[AboutViewController alloc] init];
        abv.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:abv …
Run Code Online (Sandbox Code Playgroud)

ios5

4
推荐指数
2
解决办法
6872
查看次数

用nokogiri解析javascript函数元素

我正在尝试使用mechanize + nokogiri解析脚本标记中的值.这是我能够得到的

1.9.3-p125 :107 > agent.page.search("script")[7]
=> #<Nokogiri::XML::Element:0x3ff1e10f3ff8 name="script" attributes=
[#<Nokogiri::XML::Attr:0x3ff1e10f3f80 name="type" value="text/javascript">] children=
[#<Nokogiri::XML::CDATA:0x3ff1e10f39b8 "countdownFactory.create('47884', '1333724400000', '');countdownFactory.create('48436', '1333638000000', '');countdownFactory.create('46085', '1333627200000', '');countdownFactory.create('48151', '1333551600000', '');countdownFactory.create('48211', '1333638000000', '');countdownFactory.create('48511', '1333551600000', '');countdownFactory.create('48513', '1333551600000', '');countdownFactory.create('48482', '1333551600000', '');countdownFactory.create('48439', '1333551600000', '');countdownFactory.create('48299', '1333551600000', '');countdownFactory.create('48272', '1333670400000', '');countdownFactory.create('46371', '1333638000000', '');countdownFactory.create('48254', '1333724400000', '');countdownFactory.create('46086', '1333638000000', '');countdownFactory.create('48317', '1333638000000', '');countdownFactory.create('48435', '1333724400000', '');countdownFactory.create('47223', '1334059200000', '');countdownFactory.create('48234', '1333972800000', '');countdownFactory.create('48407', '1333638000000', '');countdownFactory.create('48429', '1333638000000', '');countdownFactory.create('48212', '1333638000000', '');countdownFactory.create('48275', '1333551600000', '');countdownFactory.create('48205', '1333551600000', '');countdownFactory.create('48414', '1333886400000', '');countdownFactory.create('48185', '1333713600000', '');countdownFactory.create('48215', '1333540800000', '');countdownFactory.create('47636', '1333638000000', '');">]
Run Code Online (Sandbox Code Playgroud)

如何将所有countdownFactory.create元素放入哈希?谢谢!

ruby nokogiri

1
推荐指数
1
解决办法
3067
查看次数

标签 统计

ios5 ×1

nokogiri ×1

ruby ×1