How do I use this?

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is OFF
Smilies are ON
Topic review
   

Expand view Topic review: How do I use this?

Re: How do I use this?

Post by erik » 26 Oct 2009, 03:38

Of course you are right. I had forgotten about this method because it is not recommended for general use. The reason for that is that it effectively leaks all strings that are shared this way, i.e. the strings will never be garbage collected. Then again, there are cases when this is ok, which is why this method exists.

Re: How do I use this?

Post by BlackDiamond » 25 Oct 2009, 23:01

Does this not act as a singleton?

http://www.mulle-kybernetik.com/software/EDFrameworks/Documentation/EDCommon/Classes/NSString+EDExtensions.html#-%20sharedInstance

Re: How do I use this?

Post by erik » 25 Oct 2009, 07:50

Both EDCommon and EDMessage are standard frameworks and they can be added to your project by right clicking on the "Linked Framework" group in the "Groups & Files" view, and then choosing "Add" and "Existing Frameworks..." For more background on frameworks I recommend this article on Apple's Developer site:

http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFrameworks/Frameworks.html

All that said, I'm afraid, there's nothing in these frameworks that would help with creating shared strings.

How do I use this?

Post by BlackDiamond » 24 Oct 2009, 06:03

I'm new to macs and have no unix experience. How do I add these libraries to my project? All I want to do is use a shared instance for an NSString none of the singletons I've googled seem to work.

Top

cron