views:

180

answers:

2

Hi,

First thanks so much to users in this site for many answers I stumble upon when investigating bugs...

I am working now a few months on a Obj-C project (IPhone), today I made a big discovery (in a beginners PoV) while working with a singleton. In short if you are accessing a @property with self.someProperty it will use the "(nonatomic, retain)" - or what ever settings you set for this accessor's operation, while if you are directly assigning a value to a (although) synthesized someProperty, for example like this: someProperty = [someClass fun:option]; it will not "retain" it as I had expected before. (due to not using the actual synthesizes accessor via the "." notation)

The reason I am posting this possibly obvious insight is because I have seen few threads on this site debating this exact question, while I was not able to deduct this conclusion until now..

Cheers, Roman

A: 

Could you please point at least one thread at "this site" where this obvious fact was not resolved?

This kind of information is not suitable to public here by this way.

MikZ
You are not the happy kind are you:)And if you read my post you will see that I did not say anywere that there was no resolution, just that it was not clear enough for me to understan, hopefully I made also a few to understand if they were also looking for this subject.
Romansky
Completely understand your best wishes... but your post in this style may puzzle SO structure and make search worse...P.S. I have no enough rep points to vote down.
MikZ
+1  A: 

Writing this "answer" so I can close the question.

When ever you want to use the synthesized options (set in the header for synthesized property) use the "self.property" notation, otherwise you are working "directly" with the property, you will need to manually put in effect syntesized options (retain etc..).

Hope it helps some one..

Romansky