|
Re: Getting class when instantiating a singleton
Yes.
I’m trying this out to see if this is valid.
From the headers for NSObject.h;
+ (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
From the Quick Help ins[pector
Yes.
I’m trying this out to see if this is valid.
From the headers for NSObject.h;
+ (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
From the Quick Help ins[pector
|
By
Alex Zavatone
·
#284
·
|
|
Re: Getting class when instantiating a singleton
That's "instance = [self new];", right? :)
That's "instance = [self new];", right? :)
|
By
Steve Christensen <punster@...>
·
#283
·
|
|
Re: Getting class when instantiating a singleton
I’m able to turn the sharedInstance method from being dependent on my changing the class name and being this:
@implementation CrewActionsDataSingleton
+ (instancetype)sharedInstance
{
static
I’m able to turn the sharedInstance method from being dependent on my changing the class name and being this:
@implementation CrewActionsDataSingleton
+ (instancetype)sharedInstance
{
static
|
By
Alex Zavatone
·
#282
·
|
|
Re: Getting class when instantiating a singleton
If saving developer effort is your goal, how about setting up a text snippet in Xcode, so that you can avoid the penalty of needlessly un-typed code?
(By "un-typed" mean in the language sense, not
If saving developer effort is your goal, how about setting up a text snippet in Xcode, so that you can avoid the penalty of needlessly un-typed code?
(By "un-typed" mean in the language sense, not
|
By
Ben Kennedy
·
#281
·
|
|
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
On 8/30/2017 1:58 AM, Gerriet M. Denkmann wrote:
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
On 8/30/2017 1:58 AM, Gerriet M. Denkmann wrote:
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
|
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
·
|