我在界定我的变数时,有一整座标的栏目。
www.un.org/Depts/DGACM/index_spanish.htm 方法,应当将其释放到[myGreatVariable release];
或[自.myGreatVariable release];
。 他们目前以原来的方式工作。 这究竟是什么问题? 从现在起就开始,或者如果我回头来,在我的所有班子里改变所有这些班子,那是一件好事,因为事情实际上还没有释放。
我在界定我的变数时,有一整座标的栏目。
www.un.org/Depts/DGACM/index_spanish.htm 方法,应当将其释放到[myGreatVariable release];
或[自.myGreatVariable release];
。 他们目前以原来的方式工作。 这究竟是什么问题? 从现在起就开始,或者如果我回头来,在我的所有班子里改变所有这些班子,那是一件好事,因为事情实际上还没有释放。
如果你回头处理,就没有问题了,尽管前者是一个比它更有效率的渠道。 但是,您有第三种选择,即:<条码>本身.myFairly GoodVariable = nil;,该方法依靠固定方法进行释放(但两种或三种斜线的轨道效率较低)。
I suspect you ll find different arguments for what you should do. Some folks argue you should use the instance variable (sans self.
) for all read accesses. Others will argue that you should use the property access (ie, with self.
) pretty much everywhere. I tend to fall into the latter camp, but I could accept arguments from the other side.
但重要的是保持合理一致。 如果你与其他人合作,如果你能够有一个团队“标准”。
(我想做的一件事是将dealloc
方法放在桌面上,然后在通常结束的底层。) 这样,你就更有可能记住,如果你增加/改变财产及相关的<条码>@synthesize的话,将更新<条码>。
Don t use [自.myGreatVariable release]
. 正如丹尼尔指出的,它将在这方面开展工作,但它是最“天化”的版本,并且将在<条码>-dealloc以外的任何地方做
你们应选择其中一项,并实现标准化:
[myGreatVariable release];
self.myGreatVariable = nil;
(选择主要是个人选择。) 我只使用<代码>dealloc中的第一种形式,因为固定装置有时是非自然的,并且具有副作用,而<代码>dealloc<>/code”的目标是高效、明确地利用所有资源,避免因意外国家变化而行走。
在交易中使用“自费=无”的问题是,如果你推翻了“可变”的话,它可以引发更多的行动。 例如,有些班级将发出代表的信号,只要有变化的价值观,但你可能不想这样做。 使用“[可变释放]”就比较安全。
希望阿农发中心很快将结束所有这一切。
How do i change the size of the Windows Mobile 6 Emulator. Its fixed at 32mb. I read this post: Increasing Windows Mobile 5 Emulator Storage But it only helps for the 5.0 version. Isnt there any way ...
I m trying to figure out a way to allocate a block of memory that is accessible by both the host (CPU) and device (GPU). Other than using cudaHostAlloc() function to allocate page-locked memory that ...
I am working on a project involving optimizing energy consumption within a system. Part of that project consists in allocating RAM memory based on locality, that is allocating memory segments for a ...
I thought I was doing the right thing here but I get several warnings from the Build and Analyze so now I m not so sure. My assumption is (a) that an object I get from a function (dateFromComponents: ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a question about the following C code: void my_function() { int i1; int j1; // Do something... if (check_something()) { int i2; int j2; // Do ...
I m learning about Memory management in C# from the book "Professional C#" The presence of the garbage collector means that you will usually not worry about objects that you no longer need; ...
This is on the iPhone. So what if I have a function like - (SomeObject*)buildObject; Do I need to pass in a variable that I have already alloc d outside like - (void)assignObject(SomeObject** out);...