|
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
·
|
|
WkWebView with URLSchemeHandler
macOS 15.4; Xcode Version 11.4 (11E146)
I have a window with a WkWebView.
This WkWebView should handle a special scheme.
The only way to do this that I know of, is:
@IBOutlet var wkWebView:
macOS 15.4; Xcode Version 11.4 (11E146)
I have a window with a WkWebView.
This WkWebView should handle a special scheme.
The only way to do this that I know of, is:
@IBOutlet var wkWebView:
|
By
Gerriet M. Denkmann
·
#1247
·
|
|
Re: Correcting scrollbar after app state restoration
Thanks for pointing out that method. I tried it, but it didn't work. Not sure when the scrollbar is being restored to a stupid value. But, I've added predicate restoration, and that solves it. I also
Thanks for pointing out that method. I tried it, but it didn't work. Not sure when the scrollbar is being restored to a stupid value. But, I've added predicate restoration, and that solves it. I also
|
By
Steve Mills
·
#1246
·
|
|
Re: Correcting scrollbar after app state restoration
You can send reflectScrolledClipView: to the NSScrollView instance after state restoration.
But it should basically never be necessary to call this method manually, so even if it fixes it, something
You can send reflectScrolledClipView: to the NSScrollView instance after state restoration.
But it should basically never be necessary to call this method manually, so even if it fixes it, something
|
By
Allan Odgaard <groups-io@...>
·
#1245
·
|