Post

Replies

Boosts

Views

Activity

Reply to I am not getting the proper answer for this 2D array addition guys can anybody help me
Either you expect the + operator on arrays to do something it does not do, or you don't appreciate what you're applying the + operator in the expression { $0 + $1 } to. From https://developer.apple.com/documentation/swift/array static func + (lhs: Array<Element>, rhs: Array<Element>) -> Array<Element> this is the + you are using - it takes an Array of ints on each side, and returns another array of ints. The new array is a combination of the two (by appending the $1 to $0), not an array constructed by member wise addition. To do what you intend, you need to dip one level deeper so that you call zip on an array of ints, not an array of arrays of int. Then the + operator would be the usual one which adds two integers.
Aug ’21
Reply to “Unidentified Keyboard”: how does macOS identify a keyboard?
I can't directly answer your question. Obviously Apple knows the layout of all the keyboards it has shipped, so it could just be using the vid/pid of the keyboard. But if you can control the USB descriptor of your device, and it isn't actually a keyboard, why make it emulate a keyboard? If you want keyboard-like functionality, just make it a vendor-defined device. The OS won't grab it and the device won't send keystrokes when you don't want it to, but you can still access it using the HID Manager.
Topic: App & System Services SubTopic: Hardware Tags:
Aug ’21
Reply to “AppName.pkg” cannot be opened because it is from an unidentified developer.
If you don't want your users to have to right-click and choose open, you need to notarize the application. In Xcode, choose Archive, then Distribute App. Select the Developer ID option, then Upload. The app should be signed with your company's developer ID, uploaded to Apple, notarized, and returned to you in your archive. Notarization can take a few minutes. You can also do this from a script, see man altool
Topic: Code Signing SubTopic: General Tags:
Jan ’22
Reply to Control-Drag of Button to ViewController generates error
sounds like you missed a step. You probably haven't specified the class name of your view controller, which probably doesn't want to be "UIViewController", but some subclass of it that you write. In Xcode, select the View Controller in the Storyboard or .xib file, then in the Identify inspector in the right, enter or select the correct name of your custom view controller class.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’22
Reply to Differences between USB Flash and USB HDD
what criteria do you want to use? What criteria are Windows and Linux using? You can find out if a disk is removable, and what connection method is used for it. Check out the IORegistry, use ioreg at the command line, or IORegistryExplorer from the developer tools. You can walk the IORegistry tree programmatically to pull out the details you may need. Also, why do you need to know? They're both mass storage devices...
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’22
Reply to xcode doesn't work
can you see Xcode in Activity Monitor? How about the running indicator beneath its icon in the Dock? If you open the Xcode package you can run the Contents/MacOS/Xcode inside it from the command line. The output may give you a clue. Or, look at the Console log when you try to launch the application.
Jan ’22