Post

Replies

Boosts

Views

Activity

Reply to Application Error ?
I added // for the #include <Cocoa/Cocoa.h> to start programming the interface of NSApplication Why did you do that??? to start programming the interface of NSApplication does not make sense. In modern C (as you can find C99, it is not too modern), you need to import/include the prototype definitions of all functions, before using them. You need to import the prototype definition of NSApplicationMain, if you want to use it. Which is included in <Cocoa/Cocoa.h>.
Oct ’21
Reply to Shell Script | AWK | Variable inside FOR-Loop
Awk is an open sourced language available on various platforms. Although awk may be included in most versions of macOS, it is provided as is, no support. You should better find a better place to learn awk. (And in fact, there are so many sites about awk.) By the way, I think = (a single equal sign) is an assignment operator in awk, not a comparison operator.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’21
Reply to XCode code completes in comments
I cannot reproduce the issue neither with Xcode 13 nor Xcode 13.1 RC. I do not know what Nimble is, but if you once installed it in any of the projects on your Mac, it might be affecting. Better try the same thing on a brand new Mac (on which you have never used Nimble thing). Even if that was not the cause of the issue, you may need to find the condition to reproduce it.
Oct ’21
Reply to MacBook Pro ram requirements for Swift
You should better watch this thread: For xcode development, is the new macbook pro m1 pro 16gb good ? Or do I need 32 gb? In my opinion, 32 GB is enough for a while. But you should better have in mind that you cannot add more RAMs after you bought a new MacBook Pro. The answer from Graphics and Games Engineer would be helpful for you.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to JSON decoding challenges with Combine
OK, after a little research, I see that the JSON response includes some summary info about the request and is started with a curly bracket (the "dictionary" indicator.) So is there a way to specify not to include that data and just return the foods? Or is the right answer to create a add a dictionary property to my class and have it include the summary info variables as well as the [FoodItems] as an element of the dictionary? Thanks for showing the data, the definition and the error info. You may need another struct containing some summary info about the request: struct FoodSearchResult: Codable { let totalHits, currentPage, totalPages: Int let pageList: [Int] let foodSearchCriteria: FoodSearchCriteria let foods: [FDCFoodItem] } struct FoodSearchCriteria: Codable { let query, generalSearchInput: String let pageNumber, numberOfResultsPerPage, pageSize: Int let requireAllWords: Bool } (Assuming your FDCFoodItem is really correct.) And pass it to .decode:             .decode(type: FoodSearchResult.self, decoder: JSONDecoder()) You may also need to modify the closure passed to receiveValue::             } receiveValue: { [weak self] result in                 self?.foods = result.foods                 print("result: \(result)") // debug statement                 print("self?.foods: \(String(describing: self?.foods))") // debug statement             }
Topic: App & System Services SubTopic: General Tags:
Oct ’21
Reply to Getting data from SQLite in SwiftUI
It looks as though it may be possible but the options I've seen don't seem very satisfactory and are overly complicated. Unless you clarify what you have seen and what you think very satisfactory, readers are just confused. As far as I know, using SQLite database directly in iOS apps cannot be so simple even if you use some third party wrappers. If you don't want the users to lose their information, you may update your Cordova app to save the data somewhere not in raw SQLite database (I mean, JSON on some cloud storage or something like that). Or learn how to use SQLite in iOS, even if it it not satisfactory for you.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to It seems Xcode 13.1 RC requires the unreleased macOS 12. Will this requirement also affect the official release of Xcode 13.1?
It seems Xcode 13.1 RC requires the unreleased macOS 12.  What source says so? In Apple's official Release Notes, you can find this: Overview Xcode 13.1 RC includes SDKs for iOS 15, iPadOS 15, tvOS 15, watchOS 8, and macOS Monterey 12. The Xcode 13.1 release candidate supports on-device debugging for iOS 9 and later, tvOS 9 and later, and watchOS 2 and later. Xcode 13.1 RC requires a Mac running macOS 11.3 or later. macOS 11.3 or later is the requirement to run Xcode 13.1 RC. And RC is very near to the released version, in the past the released version had exactly the same build number as RC. I would expect Xcode 13.1 runs on macOS 11.3 or later. Apple says Xcode 13 is required to develop apps on Macs running macOS Monterey . But it is not the requirement to run Xcode 13.1.
Oct ’21