Post

Replies

Boosts

Views

Activity

Reply to How to validate a property list has the right structure
As I said, it's a property list, so the only validation I get is that it is a well-formed property list. It's the validating the values that I'm stuck on. Is there something better than code like this? NSObject *name = dict[@"name"]; if (![name isKindOfClass:[NSString class]]) { // report failure } In Swift I would be using the as? operator, and I guess that this is the closest equivalent. (My memory only recalled the isa method, but further searching turned up isKindOfClass.)
Topic: App & System Services SubTopic: General Tags:
Feb ’25
Reply to How to validate a property list has the right structure
As I said, it's a property list, so the only validation I get is that it is a well-formed property list. It's the validating the values that I'm stuck on. Is there something better than code like this? NSObject *name = dict[@"name"]; if (![name isKindOfClass:[NSString class]]) { // report failure } In Swift I would be using the as? operator, and I guess that this is the closest equivalent. (My memory only recalled the isa method, but further searching turned up isKindOfClass.)
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to Looking for advice on app architecture
Nice to know that I'm not alone. SwiftUI does make sense for the subviews, so I'll probably try to make the main view with AppKit. It will be an interesting challenge.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’25