On 15.04.2013, at 12:44, Tom Davie wrote:
> Note also – simply using your app delegate as a store for things that aren't
> singletons, but only one of them is pointed at by your app delegate is also
> horrific – you're just substituting one singleton for another.
If it were only that! At least
On 16/04/2013, at 10:18 AM, Graham Cox wrote:
> I don't know what you mean by "dependency injection", it's not a term I've
> heard of
OK, I looked it up. I hadn't heard the term but I'm very familiar with the
concept it refers to. Sometimes the service or dependent entity should be a
singl
On 15/04/2013, at 8:44 PM, Tom Davie wrote:
> Wow, I really can't get my head around this one. You make bold statements
> like "GLOBALS ARE BAD NEWS" (which I 100% agree with), but then follow up
> with effectively "use singletons instead". Singletons bring with them 95% of
> the problems g
On 15 Apr 2013, at 00:25, Graham Cox wrote:
>
> On 14/04/2013, at 2:08 PM, YT wrote:
>
>> My struggle is partially due to my lack of experience in OOP. I just have
>> not written enough OO code as of yet. AND I'm very new to Objective-C.
>> Hence my lack of experience and working knowledge
On 14/04/2013, at 2:08 PM, YT wrote:
> My struggle is partially due to my lack of experience in OOP. I just have not
> written enough OO code as of yet. AND I'm very new to Objective-C. Hence my
> lack of experience and working knowledge of Objective-C.
>
> extern int gFoobar;
>
> I underst
On 14.04.2013, at 06:29, Steve Mills wrote:
> Oh, that's easy, once you know how to make singletons. OK, I wouldn't call it
> easy, but it's the right thing to do.
If the C++ Steve wrote helps you understand things better, here's a 1-to-1
translation of that code to the equivalent in Objective
On Apr 13, 2013, at 9:51 PM, Jens Alfke wrote:
> C++ static initializers are evil, though, at least the ones that run code.
> They run super early, in an undefined order, with no way to specify
> dependencies between them; so if you’re not careful they can slow down launch
> and/or cause weird
On Apr 13, 2013, at 10:02 PM, Allan Odgaard wrote:
>> C++ static initializers are evil, though, at least the ones that run code.
>> They run super early, in an undefined order, with no way to specify
>> dependencies between them; so if you’re not careful they can slow down
>> launch and/or ca
On Apr 14, 2013, at 10:51, Jens Alfke wrote:
> C++ static initializers are evil, though, at least the ones that run code.
> They run super early, in an undefined order, with no way to specify
> dependencies between them; so if you’re not careful they can slow down launch
> and/or cause weird n
On Apr 13, 2013, at 23:08:41, YT wrote:
> int gFoobar = 42;
>
> Then reference it elsewhere as:
>
> extern int gFoobar;
>
> I understand that solution and its working for me right now. I have a PreRun
> Class that defines the object and I instantiate in main.m just before the
> line
> retu
First just to clear a distraction...
I didn't want to actually create my own version of Preferences. In fact that
was a mistake to even mention it. Sorry, I was flailing in my mind trying to
describe what I was struggling with and out came Preferences as an example.
Totally throw away the
On Apr 13, 2013, at 6:38 AM, Scott Ribe wrote:
>> YT wants to create an object, which isn’t as straightforward because you
>> can’t have an object literal in Objective-C. Instead you declare a global
>> pointer and initialize it early on.
>
> Oh, right, I work in Objective-C++, so I don't hav
On Apr 12, 2013, at 10:08 PM, Jens Alfke wrote:
> YT wants to create an object, which isn’t as straightforward because you
> can’t have an object literal in Objective-C. Instead you declare a global
> pointer and initialize it early on.
Oh, right, I work in Objective-C++, so I don't have that l
On 13 Apr 2013, at 13:45, Uli Kusterer wrote:
> On 13.04.2013, at 06:08, Jens Alfke wrote:
>> On Apr 12, 2013, at 6:54 PM, Scott Ribe wrote:
>>
>>> Yes, extremely easy, just "create" the var, as in:
>>>
>>> int gFoobar = 42;
>>
>> YT wants to create an object, which isn’t as straightforward
On 13.04.2013, at 06:08, Jens Alfke wrote:
> On Apr 12, 2013, at 6:54 PM, Scott Ribe wrote:
>
>> Yes, extremely easy, just "create" the var, as in:
>>
>> int gFoobar = 42;
>
> YT wants to create an object, which isn’t as straightforward because you
> can’t have an object literal in Objective-
FYi, it's advice, not advise.
Advice is what you give, advise is the giving of advice.
But I like Matt Galloway's singleton approach for a class you can import and
use everywhere.
http://www.galloway.me.uk/tutorials/singleton-classes/
On Apr 12, 2013, at 9:30 PM, YT wrote:
> Perhaps my appro
On Apr 12, 2013, at 6:54 PM, Scott Ribe wrote:
> Yes, extremely easy, just "create" the var, as in:
>
> int gFoobar = 42;
YT wants to create an object, which isn’t as straightforward because you can’t
have an object literal in Objective-C. Instead you declare a global pointer and
initialize
On Apr 12, 2013, at 7:30 PM, YT wrote:
> Is this even possible?
Yes, extremely easy, just "create" the var, as in:
int gFoobar = 42;
Then reference it elsewhere as:
extern int gFoobar;
***NOW*** whether or not this is a good thing to do, particularly for your
preferences, and also some detai
On 13/04/2013, at 11:30 AM, YT wrote:
> Perhaps my approach is wrong. Looking for advise.
>
> So I'd like to define a Class called Preference.
>
> In main.m I'd like to create an object called myPreferences before the code
> line
>
> return NSApplicationMain(argc, (const char**)); is run;
>
Perhaps my approach is wrong. Looking for advise.
So I'd like to define a Class called Preference.
In main.m I'd like to create an object called myPreferences before the code line
return NSApplicationMain(argc, (const char**)); is run;
I assume the object myPreferences will persist the life of
20 matches
Mail list logo