How do I use this?

Discussion of the EDMessage and EDCommon frameworks.

How do I use this?

Postby 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.
BlackDiamond
 
Posts: 2
Joined: 24 Oct 2009, 06:01

Re: How do I use this?

Postby 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.
erik
 
Posts: 90
Joined: 10 Oct 2009, 15:22
Location: Hamburg, Germany

Re: How do I use this?

Postby 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
BlackDiamond
 
Posts: 2
Joined: 24 Oct 2009, 06:01

Re: How do I use this?

Postby 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.
erik
 
Posts: 90
Joined: 10 Oct 2009, 15:22
Location: Hamburg, Germany


Return to ED Frameworks



cron