FROM : Antonio Nunes
DATE : Wed Apr 16 18:06:13 2008
On Apr 16, 2008, at 11:11 AM, Mike Abdullah wrote:
> Also, another alternative is to follow a singleton pattern like
> NSFileManager et. al and implement these as instance methods. If you
> do persist with either of the ObjC-based approaches, I would also
> suggest changing your first method to:
>
> + (float)systemVolume;
>
> as this is more common Cocoa practice. The "get" prefix is generally
> reserved for methods that return something by reference.
Very true, I overlooked that when I adapted the original code samples.
I've updated the downloadable file to reflect the change.
> Actually, I have a further alternative that I've just thought of.
> Rather than declaring your own class for these methods, you could
> keep them as class methods, but turn it into a category on NSSound.
Cool. Now why didn't I think of that? I like this much better. So I've
created an alternative implementation as a category on NSSound. It's
available here:
http://sintraworks.com/media/code/ANNSSoundSystemVolumeAdditions.zip
António
-----------------------------------------------------------
What you have inside you expresses itself through both your
choice of words and the level of energy you assign to them.
The more healed, whole and connected you feel inside,
the more healing your words will be.
--Rita Goswami
-----------------------------------------------------------
DATE : Wed Apr 16 18:06:13 2008
On Apr 16, 2008, at 11:11 AM, Mike Abdullah wrote:
> Also, another alternative is to follow a singleton pattern like
> NSFileManager et. al and implement these as instance methods. If you
> do persist with either of the ObjC-based approaches, I would also
> suggest changing your first method to:
>
> + (float)systemVolume;
>
> as this is more common Cocoa practice. The "get" prefix is generally
> reserved for methods that return something by reference.
Very true, I overlooked that when I adapted the original code samples.
I've updated the downloadable file to reflect the change.
> Actually, I have a further alternative that I've just thought of.
> Rather than declaring your own class for these methods, you could
> keep them as class methods, but turn it into a category on NSSound.
Cool. Now why didn't I think of that? I like this much better. So I've
created an alternative implementation as a category on NSSound. It's
available here:
http://sintraworks.com/media/code/ANNSSoundSystemVolumeAdditions.zip
António
-----------------------------------------------------------
What you have inside you expresses itself through both your
choice of words and the level of energy you assign to them.
The more healed, whole and connected you feel inside,
the more healing your words will be.
--Rita Goswami
-----------------------------------------------------------
| Related mails | Author | Date |
|---|---|---|
| Antonio Nunes | Apr 16, 09:23 | |
| Jean-Daniel Dupas | Apr 16, 10:06 | |
| Antonio Nunes | Apr 16, 10:35 | |
| Mike Abdullah | Apr 16, 12:11 | |
| Antonio Nunes | Apr 16, 18:06 | |
| Mike Abdullah | Apr 16, 18:28 |






Cocoa mail archive

