Re: Objective-C selector names in disassembly

2022-04-03 Thread Martin Wierschin via Cocoa-dev
ote: > > Yes. Are you disassembling a release version or a debug version? > >> On Apr 3, 2022, at 2:36 PM, Martin Wierschin via Cocoa-dev >> wrote: >> >> Hi everyone, >> >> I have a question that's been an irritating me for a long time. Is there any &

Re: Objective-C selector names in disassembly

2022-04-03 Thread Martin Wierschin via Cocoa-dev
;t bother to do this during debugging. Oh well. Thanks again! ~Martin Wierschin > On Apr 3, 2022, at 1:55 PM, dev.iceberg wrote: > > Hopper Disassembler ? > > Envoyé de mon iPhone > >> Le 3 avr. 2022 à 21:36, Martin Wierschin via Cocoa-dev >> a écrit : >&g

Objective-C selector names in disassembly

2022-04-03 Thread Martin Wierschin via Cocoa-dev
Hi everyone, I have a question that's been an irritating me for a long time. Is there any way to get Xcode (or other tools) to show Objective-C selector names in disassembled framework's code? Back in the good old days viewing assembly for any Obj-C method in Xcode would automatically give you

Re: Several different NSUserDefaults in the same app?

2021-04-06 Thread Martin Wierschin via Cocoa-dev
This topic of default defaults (aka initial, hardcoded, or fallback values) came up recently on this developer blog: https://mjtsai.com/blog/2021/04/02/foil-userdefaults-property-wrapper/ I've always used this same approac

Re: Exception not being caught in try statement

2021-03-29 Thread Martin Wierschin via Cocoa-dev
Breaking the RTFD loading process down into subtasks is a good idea. It might be worth trying to sidestep the issue using NSAttributedString. You can try loading the data yourself as Mike suggested and then use initWithRTFD or initWithRTFDFileWrapper. Once you have the text in an attributed stri

Re: Cocoa dylib access by C program

2020-11-13 Thread Martin Wierschin via Cocoa-dev
A nice way to do this is to have a bridge header file that only declares C functions. The corresponding .m source code file will have C functions that natively call Objective-C methods. This same header can be included in .c files without any trouble, letting them have access to Obj-C code via t

NSView draws unwanted "seams" for certain zoom factors

2020-10-08 Thread Martin Wierschin via Cocoa-dev
I have a large custom NSView subclass that's set as an NSScrollView's documentView. This view achieves zooming in the standard AppKit way, by having a zoom factor between the frame and bounds sizes, eg: frame.size.width = bounds.size.width * 2.0. This has worked just fine for years. The problem

Re: Localization under Catalina

2020-05-27 Thread Martin Wierschin via Cocoa-dev
> Auto layout (not auto-resizing) is independent of localization. You don’t > need to switch to auto layout to support Base localization It's true that autolayout has many benefits aside from localization. But I'd say it's only partially true that you can switch to Base.lproj for localization

Re: Localization under Catalina

2020-05-27 Thread Martin Wierschin via Cocoa-dev
I remember AppleGlot. I also remember how terrible it was, at least way back when it was first around. In the intervening years I preferred loc-suite. As Georg said, it's a very good tool. But all that's obsolete now. You ultimately should convert your nibs to Base.lproj. The current Xcode loca

Re: [OT] NSTimer +timerWithTimeInterval:

2020-04-30 Thread Martin Wierschin via Cocoa-dev
Sandor is correct. Using "new" in a method name is not forbidden. That method just has to return an object with a +1 retain count. The relevant docs are here: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/2994-B

Re: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-03 Thread Martin Wierschin via Cocoa-dev
Yes, working through the NSTextStorage is the way to go. To replace its entire contents you can use -replaceCharactersInRange:withAttributedString: with a range that encompasses all

Re: Difficulties with recovering NSAttributedString attachments from saved RTFD

2019-12-01 Thread Martin Wierschin via Cocoa-dev
> let savedRtfd = originalString.rtfd(from:NSRange(0.. recoveredAttachment.contents is still nil. Your core problem is RTF/RTFD encoding. There's simply no guarantee those formats will preserve everything that's supported by the Apple text system, including NSTextAttachment data. Even features