【发布时间】:2011-08-01 06:58:28
【问题描述】:
1) 对于接口 .h 文件,我应该导入类 (#import "Person.h") 还是应该使用 @class (@class Person)?而且我应该总是在 .m 中使用 import,对吧?
2) 如果我不使用自动旋转,我可以摆脱以下方法吗?
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
3) 在接口中声明变量时,是否需要将变量与属性分开?我看到两种方式都在完成。
编辑:
这些方法呢?
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}
【问题讨论】:
标签: iphone objective-c xcode