|
Re: Getting class when instantiating a singleton
It makes the code copy/paste-able. No dependency on the name of class you are adding it to.
It makes the code copy/paste-able. No dependency on the name of class you are adding it to.
|
By
Alex Zavatone
·
#280
·
|
|
Re: Getting class when instantiating a singleton
Why is this necessary? Apologies if I'm missing something obvious, but what's wrong with literally using DataSingleton (in your example)?
Even if the method is called on a subclass it should still
Why is this necessary? Apologies if I'm missing something obvious, but what's wrong with literally using DataSingleton (in your example)?
Even if the method is called on a subclass it should still
|
By
Ben Kennedy
·
#279
·
|
|
Re: Getting class when instantiating a singleton
Awesome. TY. +1
By
Alex Zavatone
·
#278
·
|
|
Re: Getting class when instantiating a singleton
No no - not:
static id *instance;
but
static id instance;
The id type is itself a pointer to an object.
- Jon
No no - not:
static id *instance;
but
static id instance;
The id type is itself a pointer to an object.
- Jon
|
By
Jon Gotow
·
#277
·
|
|
Re: Getting class when instantiating a singleton
I wish.
Pointer to non-const type ‘id’ with no explicit ownership.
I wish.
Pointer to non-const type ‘id’ with no explicit ownership.
|
By
Alex Zavatone
·
#276
·
|
|
Re: Getting class when instantiating a singleton
Couldn't you just make it:
static id instance;
instead?
- Jon
Couldn't you just make it:
static id instance;
instead?
- Jon
|
By
Jon Gotow
·
#275
·
|
|
Getting class when instantiating a singleton
I did this a few years ago but can’t find my sample and figured I’d ask the brain trust here.
In iOS, when I’m making an Objective-C singleton, in the public method that returns the
I did this a few years ago but can’t find my sample and figured I’d ask the brain trust here.
In iOS, when I’m making an Objective-C singleton, in the public method that returns the
|
By
Alex Zavatone
·
#274
·
|
|
Re: How to Translate iOS UIView Point to Mac NSView
Or have your subclass implement -isFlipped to return YES.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
Or have your subclass implement -isFlipped to return YES.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
|
By
Keary Suska
·
#273
·
|
|
Re: Preprocessor Deployment Target
What you need is
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
MAC_OS_X_VERSION_MIN_REQUIRED is the deployment version, and MAC_OS_X_VERSION_MAX_ALLOWED is the SDK
What you need is
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
MAC_OS_X_VERSION_MIN_REQUIRED is the deployment version, and MAC_OS_X_VERSION_MAX_ALLOWED is the SDK
|
By
James Walker
·
#272
·
|
|
Re: How to Translate iOS UIView Point to Mac NSView
Hi,
This seems to do the trick:
-(LTWNativeRectType) adjustRectForPlatform:(LTWNativeRectType) theRect
{
LTWNativeRectType myRect;
myRect = theRect;
myRect.origin.y = self.frame.size.height -
Hi,
This seems to do the trick:
-(LTWNativeRectType) adjustRectForPlatform:(LTWNativeRectType) theRect
{
LTWNativeRectType myRect;
myRect = theRect;
myRect.origin.y = self.frame.size.height -
|
By
Dave
·
#271
·
|
|
Re: How to Translate iOS UIView Point to Mac NSView
Mac uses bottom-left for the origin, which is why everything is "flipped in the Y direction".
You *can* do the calculation to move the origin to top-left and scale the transform in the opposite Y
Mac uses bottom-left for the origin, which is why everything is "flipped in the Y direction".
You *can* do the calculation to move the origin to top-left and scale the transform in the opposite Y
|
By
Glenn L. Austin
·
#270
·
|
|
Re: How to make typeAlias ?
tell application “MyApp"
open alias "Macintosh HD:path:to:file" -- HFS path
end tell
or if you don't want to use an HFS path directly:
set theFile to POSIX file "/tmp/abc" as alias
tell
tell application “MyApp"
open alias "Macintosh HD:path:to:file" -- HFS path
end tell
or if you don't want to use an HFS path directly:
set theFile to POSIX file "/tmp/abc" as alias
tell
|
By
Shane Stanley
·
#269
·
|
|
How to Translate iOS UIView Point to Mac NSView
Hi,
I’m converting some Manual Layout code from iOS to Mac.
I’m overriding “layout” in my class, it calculates and sets the Frame Rect for all its subviews. This works ok on Mac, except, as
Hi,
I’m converting some Manual Layout code from iOS to Mac.
I’m overriding “layout” in my class, it calculates and sets the Frame Rect for all its subviews. This works ok on Mac, except, as
|
By
Dave
·
#268
·
|
|
Re: Getting Windows to Appear.....
Hi,
Yeah, realised that afterwards, I made it a property for now, it will be retained by the App Manager once I add it,
Cheers
Dave
Hi,
Yeah, realised that afterwards, I made it a property for now, it will be retained by the App Manager once I add it,
Cheers
Dave
|
By
Dave
·
#267
·
|
|
Re: How to make typeAlias ?
Sorry, if my explanation was not too clear.
This is the code:
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
NSAppleEventManager *sharedAppleEventManager = [
Sorry, if my explanation was not too clear.
This is the code:
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
NSAppleEventManager *sharedAppleEventManager = [
|
By
Gerriet M. Denkmann
·
#266
·
|
|
Re: How to make typeAlias ?
Your code answers that question. What you don't explain is what you want to do, presumably with the descriptor, when you get there.
You ask about creating a typeAlias eventDescriptor, but your code
Your code answers that question. What you don't explain is what you want to do, presumably with the descriptor, when you get there.
You ask about creating a typeAlias eventDescriptor, but your code
|
By
Shane Stanley
·
#265
·
|
|
How to make typeAlias ?
I have some (old) code like:
NSAppleEventDescriptor *eventDecriptor = ….
DescType descriptorType = eventDecriptor.descriptorType;
if ( descriptorType == typeAlias ) // ‘alis’
{
… How to
I have some (old) code like:
NSAppleEventDescriptor *eventDecriptor = ….
DescType descriptorType = eventDecriptor.descriptorType;
if ( descriptorType == typeAlias ) // ‘alis’
{
… How to
|
By
Gerriet M. Denkmann
·
#264
·
|
|
Preprocessor Deployment Target
I need something like:
#if MACOSX_DEPLOYMENT_TARGET < 10.11 ← this of course does not work
… some code, which is only needed in this case …
#endif
Is this possible?
Gerriet.
I need something like:
#if MACOSX_DEPLOYMENT_TARGET < 10.11 ← this of course does not work
… some code, which is only needed in this case …
#endif
Is this possible?
Gerriet.
|
By
Gerriet M. Denkmann
·
#263
·
|
|
Re: Background color on NSView?
No, I'm not talking about subclassing NSView. I'm talking about writing two category methods in Objective-C, setBackgroundColor: and backgroundColor. In Swift, you'd call a category an extension. With
No, I'm not talking about subclassing NSView. I'm talking about writing two category methods in Objective-C, setBackgroundColor: and backgroundColor. In Swift, you'd call a category an extension. With
|
By
Gary L. Wade
·
#262
·
|
|
Re: Getting Windows to Appear.....
(code edited to get rid of the noise)
That’s what you’re doing, really? The window controller you create here has no owning references outside this method’s local variable, so it’s going to
(code edited to get rid of the noise)
That’s what you’re doing, really? The window controller you create here has no owning references outside this method’s local variable, so it’s going to
|
By
Quincey Morris
·
#261
·
|