autorelease
video clip no longer plays (autorelease issue)
I took care of a memory leak related to the alloc object, however I think I have fouled up my code as now my video clip does not play. I believe that I have caused the device to release before the cli[详细]
2023-03-08 05:29 分类:问答Use autorelease when setting a retain property using dot syntax?
I see in some sample code that autorelease is used. I am not familiar with the instances when this is required. For example, if I create an annotation object[详细]
2023-03-07 10:35 分类:问答Dictionaries, autorelease pools, and temporary objects
Let\'s say I have a dictionary full of objects for keys that may or may not be there. What is the standard practice for checking wh开发者_运维知识库ether this key exists or not?[详细]
2023-03-03 12:18 分类:问答is this line of code correct re memory management (re NSDate copy)?
is this line of code correct re memory management (re NSDate copy)? I have a class with properties: @property (nonatomic, retain) NSDate* start;[详细]
2023-03-03 03:53 分类:问答Why is release often called shortly after a local var is used instead of just autoreleasing
I often see something like the following: UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@\"Show\" style:UIBarButtonItemStylePlain target:self action:@selector(refreshPropert[详细]
2023-03-03 03:20 分类:问答returning an object retrieved from an NSMutableArray via objectAtIndex - autorelease necessary?
Scenario- I have a method that returns an object retrieved from an NSMutableArray similar to the following code which has been simplified (assume that \"myArray\" and \"currentIndex\" are iVars for th[详细]
2023-02-27 15:53 分类:问答What's the added benefit of retain/autoreleasing an already retained property?
At a project I\'m currently working on I\'m working through code of my predecessors. One of the things I encounter here and there are getters like this:[详细]
2023-02-26 03:02 分类:问答How to protect objects from autorelease?
Finally the objective-c memory management caught me. I\'m fighting with a problem now for 2 days. I´m new to Objective C and can\'t solve the problem by my own.[详细]
2023-02-19 19:10 分类:问答Is there GC in latest iphone OS?
If we useNSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; then what开发者_开发问答 method is used, either drain or release for lates iOS.no garbage collection on iOS.[详细]
2023-02-19 01:57 分类:问答Can I use [self retain] to hold the object itself in objective-c?
I\'m using [self retain] to hold a开发者_如何学Cn object itself, and [self release] to free it elsewhere. This is very convenient sometimes. But this is actually a reference-loop, or dead-lock, which[详细]
2023-02-18 08:28 分类:问答