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 App crashes at WKWebView's 'load' method
Thanks for showing more context. But you have not shown that you are using such many pods. As you may know, many pods are well-known as to cause problems at each time iOS or Xcode updates. I have tried with the exact code and URL you have shown, which causes no issues both on iOS 15 simulator or on an actual device of iOS 15.0.1. class ViewController: UIViewController { @IBOutlet weak var webView: WKWebView! let stringUrl = "https://developer.apple.com/" override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. if let url = URL(string: stringUrl) { webView.load(URLRequest(url: url)) } } } So, it is very likely that some still hidden parts of your code or any of your pods are causing the issue. Are you sure you are using WKWebView in a usual manner? For example, calling load(_:) while the webView is not visible may be considered to be an illegal usage by the recent iOS.
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