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];

}



     

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-07-14
  • 2021-11-21
  • 2021-06-05
  • 2021-06-13
猜你喜欢
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案