zoukankan      html  css  js  c++  java
  • ios 学习笔记 4

    1. 常见问题

      a,为什么创建的UIButton 点击不了,没有反应?

         原因可能是:UIView 在initWithFrame时候没有小了,超出UIWindow 区域。

      

         b, presentModalViewController动画效果

       modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

      [self dismissModalViewControllerAnimated:YES];

        c, 为什么NSDictionary的键值总是null

       初始化数字的时候最好不要直接赋值,要像这样[NSNumber numberWithInt:0 ]

        d, loadView为什么会不停的执行(循环)

        如下:

      

    - (void)loadView
    {
    HelloView *helloView=[[[HelloView alloc] init]autorelease];

    [helloView setNeedsDisplay];
    [self.view addSubview:helloView];

    }

       是因为缺少 [super loadView];

    正确的是

    - (void)loadView
    {
    [super loadView];
    HelloView *helloView=[[[HelloView alloc] init]autorelease];

    [helloView setNeedsDisplay];
    [self.view addSubview:helloView];

    }



         

  • 相关阅读:
    数组的地址和vector数组的地址
    字节跳动 测试开发工程师 面经
    最短路径树
    SPFA
    树的直径
    树的重心
    CF1401D Maximum Distributed Tree
    期望简述
    CF723E One-Way Reform
    CF1409E Two Platforms
  • 原文地址:https://www.cnblogs.com/hubj/p/2327969.html
Copyright © 2011-2022 走看看