Property assignment followed by autorelease?

I don't think you have to worry about thread safety any more than you usually would. Having multiple threads writing to the same property is a bad thing and should be avoided (e.g. With locks) You could get rid of the autorelease using prop1 = SomeClass alloc init instead, i.e. Not using the property.

I never use autorelease unless it's necessary and in this case it isn't.

I don't think you have to worry about thread safety any more than you usually would. Having multiple threads writing to the same property is a bad thing and should be avoided (e.g. With locks). You could get rid of the autorelease using prop1 = SomeClass alloc init; instead, i.e.

Not using the property. I never use autorelease unless it's necessary and in this case it isn't.

It depends on your property type. If you set prop1 as Retain/Copy then You should write like this: @property (nonatomic, retain) id prop1; if(self. Prop1 == nil) { SomeClass *obj = SomeClass alloc init; self.

Prop1 = obj; obj release; } if you set prop1 as Assign then @property (nonatomic, assign) id prop1; if(self. Prop1 == nil) { SomeClass *obj = SomeClass alloc init; self. Prop1 = obj retain; obj release; } In dealloc, You should relase the prop1 e.g. - (void)dealloc { prop1 release; super dealloc; } If you want to play safe with multi thread, you can choose one of following: 1. Make property atomic 2.

Use @synchronized over prop1 3. Use Mutex Lock.

If your property is assign it means you don't want to retain it. – Erik B Jul 20 at 20:40 Thanks Mark to improve Formatting… – Lightygalaxy Jul 22 at 20:34.

Having multiple threads writing to the same property is a bad thing and should be avoided (e.g. Not using the property. I never use autorelease unless it's necessary and in this case it isn't.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions