Questions tagged macos

Explore the latest questions and answers asked by our top developers.

Loading a local .scpt file in my Swift project causes error

I’m testing out a Mac app, trying to load my hello.scpt file which is in my Xcode project in the /scripts directory # even though it’s in the scripts folder, `path` will be nil unless the resource value is "hello" let path = Bundle.main.path(forResource: "hello", ofType: "scpt") let url = URL(fileURLWithPath: path!) let scriptObject = […]

By Zack Shapiro
Published
Categorised as applescript, macos, swift Tagged , ,

WKWebView content is too small when running as a Catalyst app on Mac

I started porting my iOS app (which works on iPhone and iPad) over to Mac via the Catalyst route but WKWebView is behaving very strange. All the content is too small, it looks like it thinks the monitor is 2 times bigger. The website I am displaying is responsive and works correctly on iOS devices […]

By Filip
Published
Categorised as ios, mac-catalyst, macos, wkwebview Tagged , , ,

Building Xamarin.Forms iOS project from command line with msbuild

I’m trying to build a Xamarin.Forms iOS project via command line for CI/CD purposes directly on macOS: msbuild C4S_MobileApp.iOS/C4S_MobileApp.iOS.csproj /restore /p:Platform=iPhone /p:ArchiveOnBuild=true /p:Configuration="Release" /p:BuildProjectReferences="false" The problem is the shared app project which I avoid rebuilding with /p:BuildProjectReferences="false" and whose .dll can’t be found: CSC : error CS0006: Metadata file ‘/Users/c4s/Projects/c4s_refactored/c4s-refactored-mobile-app/C4S_MobileApp/bin/iPhone/Release/netstandard2.1/C4S.MobileApp.dll’ could not be found [/Users/c4s/Projects/c4s_refactored/c4s-refactored-mobile-app/C4S_MobileApp.iOS/C4S_MobileApp.iOS.csproj] […]

By pschlz
Published
Categorised as Uncategorised Tagged , , ,

Unable to connect to Mac Server with Address=’IP Address’ and User=’Username’. The build can’t continue without a connection

I have a problem. My Visual Studio 2019 (16.8.2) is connected to my virtual Mac on VMware but getting build from the project gives the following error. I use the latest version of XCode, vs 2019 on PC , vs on Mac Error message Unable to connect to Mac Server with Address=’192.168.1.149′ and User='{username}’. The […]

By Mehrdad Ghasemi
Published
Categorised as Uncategorised Tagged , ,

Identifying and formatting XML String to readable format in XMLParser

I am working in Swift and I have a set of Data that I can encode as a String like this: <CONTAINER><Creator type="NSNull"/><Category type="NSNull"/><UMID type="NSArray"><CHILD>d1980b265cbd415c90f5d5f04efcb5df</CHILD><CHILD>7e0252c137c249fc92bd0f844effe27f</CHILD></UMID><Channels type="NSNumber">1</Channels></CONTAINER> I am looking for a way to format this string as XML with indents so I can use XMLParser to properly read through it, which it currently does not. […]

How to record audio and video in safari browser in iOS devices and Mac OS devices?

Stuck with the implementation to Record Audio & Video in safari browsers. What I have tried: I tried using WebRTC to get access to the Microphone and Camera, I was able to show the permissions but I’m unable to get access to the devices. Below is my code: navigator.mediaDevices.getUserMedia = function(constraintObj) { let getUserMedia = […]

By Anirudh
Published
Categorised as ios, macos, safari, video, webrtc Tagged , , , ,

Extend selection in NSCollectionView with Shift key

I recently reviewed one of my Applications that I released a year ago. And I see that nowadays the NSCollectionView inside it has lost the selection functioning such as SHIFT + Select now it behaving as CMD + Select. (Secondary issue: I am also not getting a selection rectangle when dragging with the mouse.) Obviously […]

By ColdSteel
Published
Categorised as cocoa, macos, nscollectionview, objective-c, swift Tagged , , , ,

Instantly format a UITextView using AttributedString

I’m developing a macOS rich-text editor that applies pre-defined style for each line of the text view. To format the lines, I’m using NSAttributedString, then, I’m inserting that string into my UITextView. To make things easier, I’m using a tool called SwiftRichString. My code looks like below. It’s straight-forward and works fine. import Cocoa import […]

By Sami Almalki
Published
Categorised as ios, macos, swift, textview, uitextview Tagged , , , ,

Sharing model between documents in a document-based app

My app is a document-based and uses NSPersistentDocument to manage its Core Data stack. It works great when each document has its own data, but now I want documents to share parts of their model. In my case, the users import large files and I don’t want to copy them for each document. I want […]

By msmialko
Published
Categorised as core-data, ios, macos Tagged , ,

Microphone does not work on some of Mac devices using maccatalist

I am using speech framework in mac-catalist application its working correctly in iOS but it doesn’t work on some of the Mac devices. It’s working fine on system A its not working on system B but all the logs (debug console) are same even settings/permissions are same. Code is correct as it’s working on some […]

By Sandip Gill
Published
Categorised as ios, mac-catalyst, macos, microphone Tagged , , ,
1 3

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq