#NSObject
i bet getting ur refcount increased feels so good for the NSObject
June 12, 2025 at 4:56 AM
Anyone else still think of Steve #Jobs every time they use classes starting with #NS, like #NSObject?

#iOS #Swift #SwiftUI #ObjectiveC #Apple #Dev #History #Humor #SteveJobs #Indie #IndieDev #Game #GameDev #macOS #watchOS #TVOS #NeXTStep #OPENSTEP
November 27, 2025 at 7:35 AM
I wrote a blog post about KVO and #swiftlang: "The Curious Case of NSObject.observe" https://pretzlav.com/blog/2025/02/16/nsobject-observe/
#iosdev
The Curious Case of NSObject.observe
A deep dive into the NSObject `observe` method for key value observation in swift.
pretzlav.com
February 17, 2025 at 5:19 AM
iOS developer PSA: if you're having trouble compiling your app that uses ImagePlaygroundViewController, there's a workaround. Implement the delegate on a Swift class that's not exposed to Objective-C (by making it private, for example).
Here's what my delegate class declaration looks like:
December 12, 2024 at 1:43 PM
Just Apple SDK things...
```swift
@MainActor
@Observable
final class ATProtoOAuthService: NSObject, ASWebAuthenticationPresentationContextProviding {
```
September 12, 2026 at 3:25 AM
remembers when Foundation meant [[NSObject alloc] init] #WWDC25
June 9, 2025 at 5:09 PM
And it wasn't that all functions were called methods. Only the ones on subclasses of NSObject and NSProxy were named method. The ones written in C, were still called functions.
February 25, 2025 at 7:42 PM
that they renamed this XCode but its still the same thing and all the stuff still inherits from NSObject
February 2, 2025 at 6:15 PM
any #swift 6 experts out there:

I'm not sure how to fix this error.

Speaker has to inherit from NSObject because it has to act as a delegate to AVSpeechSynthesizer.

But if it inherits from NSObject, then the compiler complains that its properties are mutable (which of course they must be).
January 16, 2025 at 5:37 PM
Decided to take a detour and write some scripting for ghidra to automatically recover class hierarchies based on available RTTI information. Here's the player class(the DelegateObserver inheritance is non-virtual, btw). Next up: figuring out ghidra's analysis API so I can automate all of it.
April 27, 2025 at 8:44 PM
You don't find it bizarre that if you do any serious apple dev you have to type NS over and over again?! Liek even in the NeXTSTEP sdk at some point they changed NXObject to NSObject so why not XObject?! As if Rhapsoddy had some massive backcatalog of bangers... WHWT
May 26, 2025 at 3:54 PM
@mattiem Do you have a personal rule of thumb for when you wrap Apple's own, old NSObject types in unchecked sendable boxes?

I'm looking at NSItemProvider a.t.m. to get UIImages from the photo picker. Nothing's sendable. All samples include dispatch groups, and dispatching the unpacked result […]
Original post on mastodon.social
mastodon.social
June 12, 2025 at 5:31 AM
Do I know anyone who used plain C `struct`s in their Objective-C code bases, e.g. to pass data around without attaching any behavior to it?

I realize I've always reached for NSObject subclasses to represent my immutable data types, no matter how primitive, and now I wonder if I've missed out.
March 28, 2025 at 5:29 AM
nil: puts a pointer to the instance of an Objective-C Object to the value 0.
Nil: don't know. I have never encountered it in production apps. I know it exists.
NULL: Is C pointer value of 0.
NSNull: A subclass of NSObject that represents the value of nothing inside an NSArray.
March 21, 2025 at 8:37 AM
This Swift 6 code crashes in _dispatch_assert_queue_fail(), even if the installTap() closure is empty. If I remove the MainActor annotation on the class, it works. Anybody else seen and/or worked around this?

#swift #concurrency #AVFoundation
February 27, 2025 at 3:22 PM
However, as long as those are NSObject types, there is a quick workaround. We can use NSObject metatype to bypass the restrictions. 🙃For example, take a look at working mock of SCDisplay. **Do not do this in production code**
March 30, 2025 at 10:56 PM
It’s a pretty standard “Main actor-isolated property 'property1' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode”. Nothing fancy here: Just a MainObject subclass of NSObject (like a UIView or UIViewController).
January 24, 2025 at 10:53 PM
To make a Swift required init for an ObjC class, put the init in a protocol:

@protocol PSPDFDocumentCreation

- (instancetype)initWithThing:(NSThing)thing;

@end

@interface PSPDFDocument: NSObject

@end

Thanks Kostiantyn Herasimov for pointing this out.
July 31, 2024 at 10:36 AM
This Swift 6 code crashes in _dispatch_assert_queue_fail(), even if the installTap() closure is empty. If I remove the MainActor annotation on the class, it works. Anybody else seen and/or worked around this?

#swift #concurrency #avfoundation
February 27, 2025 at 3:20 PM
File → New File → Objective-C Class

@interface LCKTumblr : NSObject.

Worlds colliding.
December 1, 2024 at 4:40 PM
#xcode #ios #swiftlang question:

Given the WCSession API function

```swift
func sendMessage(
_ message: [String : Any],
replyHandler: (([String : Any]) -> Void)?,
errorHandler: ((any Error) -> Void)? = nil
)
```

I expected this to work.

```swift
_@MainActor
final class Something: NSObject […]
Original post on sfba.social
sfba.social
June 22, 2025 at 7:41 PM
Today in ✨ FONTS ✨

A teammate shared this screenshot from the GitHub email notification of my review of their PR. I was talking about changing `value as Double as NSObject` to use `NSNumber(value: value)` instead.
February 24, 2025 at 9:45 PM
@objc
(NSObject) protocol はどんなクラスのインスタンスでもキャストまでは成功してしまう😂 Script Object ベースのクラスはプロトコルに準拠できないのでこれが必要なのね。
December 12, 2023 at 6:27 PM
お世話になった github.com/hhas/Swif… の iTunesBridge.swift の
@objc
(NSObject) ってなんで必要なんだっけと思ってと調べ直してみたけど、ここが最もやばく肝になる部分ね
December 12, 2023 at 6:16 PM
April 6, 2026 at 1:39 PM