|
Re: Abstracting a group of commonly named Selectors
Jeff,
So what you’re suggesting is…
1. Define a template implementation
2. Associate each selector pattern with that implementation
That seems like it should work. I’ll give it a try and let
Jeff,
So what you’re suggesting is…
1. Define a template implementation
2. Associate each selector pattern with that implementation
That seems like it should work. I’ll give it a try and let
|
By
Sandor Szatmari
·
#1267
·
|
|
Re: Abstracting a group of commonly named Selectors
In the designated initialise of your Parser class, you can use class_addMethod to add whatever you like to your instance's
In the designated initialise of your Parser class, you can use class_addMethod to add whatever you like to your instance's
|
By
Jeff Laing
·
#1266
·
|
|
Re: Abstracting a group of commonly named Selectors
Jeff,
Thanks for the idea… it might be a good choice… as for additional details.
The caller can be seen as a controller. It dynamically allocates model (parser) classes based on context.
The
Jeff,
Thanks for the idea… it might be a good choice… as for additional details.
The caller can be seen as a controller. It dynamically allocates model (parser) classes based on context.
The
|
By
Sandor Szatmari
·
#1265
·
|
|
Re: Abstracting a group of commonly named Selectors
You really haven't provided enough information about the caller, and you've skipped over the C programmers favourite answer.Presumably you actually NEED all those seperate selectors and can't just
You really haven't provided enough information about the caller, and you've skipped over the C programmers favourite answer.Presumably you actually NEED all those seperate selectors and can't just
|
By
Jeff Laing
·
#1264
·
|
|
Re: Abstracting a group of commonly named Selectors
Gary,
interesting…
I’ll have to see if Returning an NSValue wrapped scalar translates to the scalar result on the other side when I call -getReturnValue:
Thanks!
Sandor
Gary,
interesting…
I’ll have to see if Returning an NSValue wrapped scalar translates to the scalar result on the other side when I call -getReturnValue:
Thanks!
Sandor
|
By
Sandor Szatmari
·
#1263
·
|
|
Re: Abstracting a group of commonly named Selectors
Alex,
I am proposing letting the runtime handle the fact the object does not respond to the selector. So, under this assumption I am inside one of two methods:
-doesNotRespondToSelector: or
Alex,
I am proposing letting the runtime handle the fact the object does not respond to the selector. So, under this assumption I am inside one of two methods:
-doesNotRespondToSelector: or
|
By
Sandor Szatmari
·
#1262
·
|
|
Re: Abstracting a group of commonly named Selectors
You might want to consider using valueForUndefinedKey: and parse it to know which value you care about, and then return the value through NSValue, which can encapsulate any value, although a
You might want to consider using valueForUndefinedKey: and parse it to know which value you care about, and then return the value through NSValue, which can encapsulate any value, although a
|
By
Gary L. Wade
·
#1261
·
|
|
Re: Abstracting a group of commonly named Selectors
Well, I’m guessing here, but can’t you construct the method and use a perform selector, get the result and return it?
It seems like you are making methods, performing them, then need to perform
Well, I’m guessing here, but can’t you construct the method and use a perform selector, get the result and return it?
It seems like you are making methods, performing them, then need to perform
|
By
Alex Zavatone
·
#1260
·
|
|
Re: Abstracting a group of commonly named Selectors
Alex,
Thanks for the idea. I not sure how that helps me get the return value back to the original caller. Am I missing your point?
Here’s more details, in pseudo code
// Controller class
SEL
Alex,
Thanks for the idea. I not sure how that helps me get the return value back to the original caller. Am I missing your point?
Here’s more details, in pseudo code
// Controller class
SEL
|
By
Sandor Szatmari
·
#1259
·
|
|
Re: Abstracting a group of commonly named Selectors
Would it be possible to put them in an array or dictionary as NSStrings and use performSelector on one of them if it is present within the array or dict?
Would it be possible to put them in an array or dictionary as NSStrings and use performSelector on one of them if it is present within the array or dict?
|
By
Alex Zavatone
·
#1258
·
|
|
Abstracting a group of commonly named Selectors
I have a certain group of selectors that all follow a strict naming convention,
-(Status)parseXYZ
-(Status)parseRST
All have one line that does the same thing and return a scalar (enum) as a
I have a certain group of selectors that all follow a strict naming convention,
-(Status)parseXYZ
-(Status)parseRST
All have one line that does the same thing and return a scalar (enum) as a
|
By
Sandor Szatmari
·
#1257
·
|
|
Re: UndoManager setActionNames
The action name is part of the “view” layer in model-controller-view architecture. But most of the actual undoable ’stuff’ is in the model.
So I usually set the action name at the top level
The action name is part of the “view” layer in model-controller-view architecture. But most of the actual undoable ’stuff’ is in the model.
So I usually set the action name at the top level
|
By
Graham Cox
·
#1256
·
|
|
Re: Redrawing a view during a dragging session [SOLVED]
As usual, the answer was staring me in the face.
The old code was synchronous, the new is asynchronous.
I was restoring the view after the call to -dragImage… because that used to keep control
As usual, the answer was staring me in the face.
The old code was synchronous, the new is asynchronous.
I was restoring the view after the call to -dragImage… because that used to keep control
|
By
Graham Cox
·
#1255
·
|
|
Redrawing a view during a dragging session
Hi all,
I’m updating some legacy code that currently uses the ‘classic’ way to drag stuff, namely
[NSView dragImage:at:offset:event:pasteboard:source:slideBack:];
This code has been
Hi all,
I’m updating some legacy code that currently uses the ‘classic’ way to drag stuff, namely
[NSView dragImage:at:offset:event:pasteboard:source:slideBack:];
This code has been
|
By
Graham Cox
·
#1254
·
|
|
Re: Determining CGContext type at runtime
Thanks — it is a bit kludgey, but might do in a pinch, as you say.
In some cases I can set a flag on my drawing to tell it that the context should be a PDF at that time, since I am responsible for
Thanks — it is a bit kludgey, but might do in a pinch, as you say.
In some cases I can set a flag on my drawing to tell it that the context should be a PDF at that time, since I am responsible for
|
By
Graham Cox
·
#1253
·
|
|
Re: Determining CGContext type at runtime
I played around with it and found that bitmap (easy to create) and PDF contexts have the same CFTypeID so no help there, and that there doesn’t appear to be a public context [sub-]type property. One
I played around with it and found that bitmap (easy to create) and PDF contexts have the same CFTypeID so no help there, and that there doesn’t appear to be a public context [sub-]type property. One
|
By
Steve Christensen <punster@...>
·
#1252
·
|
|
Determining CGContext type at runtime
I need to determine whether I am drawing into a CGPDFContext or a different context at runtime.
In AppKit, I can use [NSGraphicsContext currentContextDrawingToScreen], but this is code that is passed
I need to determine whether I am drawing into a CGPDFContext or a different context at runtime.
In AppKit, I can use [NSGraphicsContext currentContextDrawingToScreen], but this is code that is passed
|
By
Graham Cox
·
#1251
·
|
|
iCloudKit - CoreData Integration: What am I doing wrong?
I have a CoreData-based app where I am experimenting with inter-device synchronization using iCloudKit. At the moment, I am running in Development mode and am using an iPad and a MacCatalyst app as
I have a CoreData-based app where I am experimenting with inter-device synchronization using iCloudKit. At the moment, I am running in Development mode and am using an iPad and a MacCatalyst app as
|
By
Rick Aurbach
·
#1250
·
|
|
Re: Manually-shown palettes not showing during app restoration
Screw it. I've switched the migration progress window to a regular window and now present it modally. This kind of window WILL appear during state restoration, unlike a palette which has been sent
Screw it. I've switched the migration progress window to a regular window and now present it modally. This kind of window WILL appear during state restoration, unlike a palette which has been sent
|
By
Steve Mills
·
#1249
·
|
|
Manually-shown palettes not showing during app restoration
I needed to add many attributes to my CoreData model. Filling in these attributes will happen during migration of old docs, which means loading all the files that each asset points to. Since it can
I needed to add many attributes to my CoreData model. Filling in these attributes will happen during migration of old docs, which means loading all the files that each asset points to. Since it can
|
By
Steve Mills
·
#1248
·
|