English 中文(简体)
在X条编码中,很少有关于“方案拟订”的速效项目
原标题:Few Quick Questions About iOS Programming in Xcode

(1) 对于接口,如果I进口类别(#import “Person.h”,或者我是否使用@class(@class Person)? 我应始终在上午使用进口吗?

(2) 如果我不使用汽车,我是否能够摆脱以下方法?

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

3) 在宣布可在接口内时,我是否需要将四舍五入物与不动产分开? 我看着这两种方法正在做。

Edit:

这些方法是什么?

- (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];
}
最佳回答
  1. @class is usually enough in your header file. See this question.
  2. All of those methods are performing their default behaviors, so you can remove them regardless of whether you use autorotation. You would want to keep them if you need to add additional behavior. (Using super means to call the superclass implementation — i.e., the implementation that would be used if you hadn t defined this method. So if you are only calling super and not doing anything else, there s no point.)
  3. It s fine to leave them out, but I think this only works after iOS 4. See this question.
问题回答
  1. 您可以使用@等类,但如果您的职等分级,则需要进口后者。 同样,议定书也是如此。 或许需要将这一类别进口,例如#import “Person.h”,放在执行档案的首位。 我可以提出一条良好的规则: 如果编辑者在此cho,进口!

  2. 是的。 正如jtbandes所指出的,这一呼吁通过super,该编码有违约执行。

  3. 如果存在财产,那么你不需要单维申报,我没有这样做,因为我不想把我的界面cl。 我认为,这项工作自目标2.0起,而不是从目标4.0起。 (例如,I ve 使用了SOS3.0)。 此外,拨号单价还有助于防止omb子,维持正确的保留额——它鼓励你使用右板。 但是,如果你的物体需要储存某些数据,但你不想披露数据,那么使用无财产的单价证券和“`````````私人'声明是好几倍。 我经常举出的一个例子是UITableViewController, 可能拥有一个阵列,以充实它。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签