Post

Replies

Boosts

Views

Activity

Reply to WeatherKit Apple Weather trademark and legal link.
Another wonderer here. I am building an independent Apple Watch app without iOS counterpart app. When adding the link to the app view, and tapping it on simulator, this error is seen in the logs: Attempting to open url https://weather-data.apple.com/legal-attribution.html with scheme https failed: Error Domain=NSPOSIXErrorDomain Code=45 "Operation not supported" UserInfo={_LSLine So is it even possible to offer this link in watchOS app or is this working on a read device? Currently cannot test this on a real watch with beta software.
Topic: App & System Services SubTopic: General Tags:
Aug ’22
Reply to Open a simple directory in XCode
If you want to just view the code, open them from the terminal: open *.* or open *.h for header files, open *.c for C files, etc. Assuming Xcode is the default app for opening these files in your system. Alternatively, create an empty C/C++ project and then add the files to it. If the code files include a cmake (https://cmake.org) project file CMakeLists.txt, then you can easily create an Xcode project from it: mkdir xcode && cd xcode cmake -GXcode .. And then open the generated Xcode project file.
Jan ’23
Reply to Azure Database for xcode
I guess you meant that you want to develop an app, using Xcode and Swift (?) programming language that connects to and uses Microsoft Azure databases? If yes, here is a step for you: https://github.com/Azure/azure-sdk-for-ios There might be other steps elsewhere, if you do some (more) searching.
Feb ’23
Reply to converting from Objective-C to Swift
One possibility is to use... tcpStreamTask = URLSession.shared.streamTask(withHostName: host, port: port) tcpStreamTask?.resume() while running { let result = try await tcpStreamTask?.readData(ofMinLength: 10, maxLength: 8096, timeout: 0) ... let toSend = dataString.data(using: .utf8)! try await tcpStreamTask?.write(toSend, timeout: 0) ... ...the URLSessionStreamTask, the example above is with async code but can do with closures too. If that is something you can do.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’23
Reply to Fatal error: Duplicate keys of type 'SOMETYPE' were found in a Dictionary.
With this change I got it working without the error. func updateVorlesung(oldID : UUID?, newV : Vorlesung) { if let oldID { if let vorlesung = vorlesungen.first(where: { $0.vID == oldID}) { vorlesung.day = newV.day } } else { self.vorlesungen.append(newV) } self.objectWillChange.send() // self.vorlesungen.removeAll { value in // value.vID == oldID // } // self.vorlesungen.append(newV) } Though here you do not actually need to create a new Vorlesung if the object already exists in the container, just pass the new/changed weekday as the second parameter to the method. Check out what works for you. Whether this fits in your overall design is another matter :)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’23
Reply to When to use private?
This is a basic object oriented design/programming thing. Related to design principles of information hiding, encapsulation and modular design. The idea is to hide all implementation details in the class/struct and only expose minimal public interface to other elements in the software. Apparently the var members of the struct are used from other structs/classes in the same package, but the private function should be used only by the GameView struct.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’23
Reply to Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Please post code here as formatted text, not screenshots. Would be easy to copy the code and test myself, but no one will try to write that code to try out what is the issue. Also, post the error also as text, we cannot see from the picture what the error is. Is that a compiler error or runtime error? Compiler doesn't check the URL for correctness so if the URL is incorrect, that would be a runtime error then?
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’23
Reply to Banking apps HDFC Bank, Kotak Bank, SC Mobile, HSBC crashing
This is typical. Many banking apps do not work or refuse to work on beta OSes. Some may work if the app developers make it so.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to WeatherKit Apple Weather trademark and legal link.
Another wonderer here. I am building an independent Apple Watch app without iOS counterpart app. When adding the link to the app view, and tapping it on simulator, this error is seen in the logs: Attempting to open url https://weather-data.apple.com/legal-attribution.html with scheme https failed: Error Domain=NSPOSIXErrorDomain Code=45 "Operation not supported" UserInfo={_LSLine So is it even possible to offer this link in watchOS app or is this working on a read device? Currently cannot test this on a real watch with beta software.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Open a simple directory in XCode
If you want to just view the code, open them from the terminal: open *.* or open *.h for header files, open *.c for C files, etc. Assuming Xcode is the default app for opening these files in your system. Alternatively, create an empty C/C++ project and then add the files to it. If the code files include a cmake (https://cmake.org) project file CMakeLists.txt, then you can easily create an Xcode project from it: mkdir xcode && cd xcode cmake -GXcode .. And then open the generated Xcode project file.
Replies
Boosts
Views
Activity
Jan ’23
Reply to Access all data in a CoreData store as a developer
Implement a feature in the app the users can use to share the data with you (email attachment of some kind)?. Or app uses HTTP to upload data to a server managed by you? Using ResearchKit, if your app is a research app?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Azure Database for xcode
I guess you meant that you want to develop an app, using Xcode and Swift (?) programming language that connects to and uses Microsoft Azure databases? If yes, here is a step for you: https://github.com/Azure/azure-sdk-for-ios There might be other steps elsewhere, if you do some (more) searching.
Replies
Boosts
Views
Activity
Feb ’23
Reply to Import large C project into Xcode 14
Maybe this helps: https://developer.apple.com/forums/thread/697944
Replies
Boosts
Views
Activity
Feb ’23
Reply to converting from Objective-C to Swift
NWConnection which seems to be for TCP and other lower level protocols, but seems to be iOS 12+ only.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Fatal error: Duplicate keys of type 'SOMETYPE' were found in a Dictionary.
vorlesungen in the for loop seems to be an array, not a dictionary. But anyways, it seems that while modifying the array within the loop is the issue? Maybe just use array find methods to search for the index of the id, without the loop, and then remove the object in that index.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Fatal error: Duplicate keys of type 'SOMETYPE' were found in a Dictionary.
What if you do the updates to a temporary array and then replace the @Published array with the temporary?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to converting from Objective-C to Swift
One possibility is to use... tcpStreamTask = URLSession.shared.streamTask(withHostName: host, port: port) tcpStreamTask?.resume() while running { let result = try await tcpStreamTask?.readData(ofMinLength: 10, maxLength: 8096, timeout: 0) ... let toSend = dataString.data(using: .utf8)! try await tcpStreamTask?.write(toSend, timeout: 0) ... ...the URLSessionStreamTask, the example above is with async code but can do with closures too. If that is something you can do.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Fatal error: Duplicate keys of type 'SOMETYPE' were found in a Dictionary.
With this change I got it working without the error. func updateVorlesung(oldID : UUID?, newV : Vorlesung) { if let oldID { if let vorlesung = vorlesungen.first(where: { $0.vID == oldID}) { vorlesung.day = newV.day } } else { self.vorlesungen.append(newV) } self.objectWillChange.send() // self.vorlesungen.removeAll { value in // value.vID == oldID // } // self.vorlesungen.append(newV) } Though here you do not actually need to create a new Vorlesung if the object already exists in the container, just pass the new/changed weekday as the second parameter to the method. Check out what works for you. Whether this fits in your overall design is another matter :)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to When to use private?
This is a basic object oriented design/programming thing. Related to design principles of information hiding, encapsulation and modular design. The idea is to hide all implementation details in the class/struct and only expose minimal public interface to other elements in the software. Apparently the var members of the struct are used from other structs/classes in the same package, but the private function should be used only by the GameView struct.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to How "Show in Finder" works in Xcode?
One option is to use Process.run() using open command passing the directory as the parameter. The same thing you would do in Terminal: open ~/Documents This will open the Documents in Finder.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Please post code here as formatted text, not screenshots. Would be easy to copy the code and test myself, but no one will try to write that code to try out what is the issue. Also, post the error also as text, we cannot see from the picture what the error is. Is that a compiler error or runtime error? Compiler doesn't check the URL for correctness so if the URL is incorrect, that would be a runtime error then?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to `try await URLSessionWebSocketTask.send()` does not return nor throw
Maybe you detected it in: } catch { print(error) } Try putting a breakpoint in print and see if that console output came from that print. Or put your own text in front of that error. If yes, that is The Way to detect that.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’23