Post

Replies

Boosts

Views

Activity

The default Safari App Extension created by Xcode does nothing.
I just installed the default safari app extension (the one created by Xcode) on my mac. Its icon is visible in Safari, but when I run the extension, nothing happens. Then when using the Safari/Developer/Web Inspector/ and choosing Sources, an Extension Script folder does not appear at the lower left. Do you have any suggestions to resolve this problem?
2
1
1.3k
Mar ’23
bookmarkDataWithOptions yields: NSCocoaErrorDomain Code=256
When calling:NSURL* aURL = [NSURL URLByResolvingBookmarkData:secBookmark options:options relativeToURL:nil bookmarkDataIsStale:&isStale error:&err];isStale is YES.When attempting to get a fresh bookmark, calling:NSData* secureBookmark = [aURL bookmarkDataWithOptions:options includingResourceValuesForKeys:nil relativeToURL:nil error:&err];produces:2019-03-11 15:53:51.603133-0700 XXX[534:8439] Error: Error Domain=NSCocoaErrorDomain Code=256 "Could not open() the item" UserInfo={NSURL=file:///Users/oldmancoyote1/Desktop/E%20Projects%20folder/Drawing/Drawing%201%20.pdf, NSDebugDescription=Could not open() the item}If I ignore isStale, there appears to be no problem. Can I safely ignore isStale?
Topic: UI Frameworks SubTopic: AppKit Tags:
2
1
1.8k
Apr ’23
Making a stand-along Safari extension
Just a simple question here: As far as I can tell, I must install my Safari extension with an app that I built in Xcode. OK. What is not clear is what happens when the user quits my installing app. Does the extension remain available through Safari, or is it deleted? Is it available the next time my user runs Safari, or does he/she have to run my installer app again?
1
0
704
Feb ’23
Safari App Extension: JavaScript script is responding to phantom messages
My Safari App Extension is having trouble with one website. This is typical for some other websites as well. Navigating to that website results in 6 “Load” events. For each such event I send a “safari.extension.dispatchMessage” to my objC code. For the first of these Load messages, my objC code sends a ‘sendMeIcons” message to “safari.self.addEventListener('message', function(event)”. The other 5 Load events are ignored by my objC code and do not send this message. safari.self.addEventListener('message', function(event) receives sendMeIcons JUST once. Yet, the event handler for this message) is invoked 4 times. The first invocation is correct. The other 3 are spurious. I have no idea why this is happening. Here is my objC code safari.self.addEventListener('message', function(event) { if (event.name === "Load My URL") { console.log('In event listener Load My URL'); ... return; } if (event.name === "sendMeIcons") { ... if (hrefs.length <1) //THIS IS ALWAYS TRUE FOR THIS TEST CASE. { safari.extension.dispatchMessage("js Found No Icons"); return; } else { ... safari.extension.dispatchMessage("IconsReturned",{"urls": arrayOfUrls}); return; } } I don't have a clue how to proceed. Any suggestions.
1
0
876
Mar ’24
How to delete my mac app's savedstate data?
I suspect that my mac app's savedstate data is over full. I've been doing a great many launches of my mac application which involves creating new files, then breaking back to Xcode. Now a stable compiled version and a later version launched from inside Xcode both crash. The Xcode crashes are preceded by NSDocumentController calls that include the suggestive phrase: "... makeDocumentForURL:withContentsOfURL:alternateContent...". As this occurs before control is given to my code, it must be part of document-based app's launch activity. The only thing I can see to do is to delete the app's savedstate data. How do I delete this savedstate data? The instructions on the web are out-of-date.
1
0
852
Jan ’21
How to stop MacOS Document-based App from automatically loading cached file
On launching my app from Xcode, my document-based app automatically apparently tries to load a cached document from a previous launch. That document appears to be corrupted as the app crashes in initWithCoder [which was called from readFromData:]. The solution appears to be to delete the cached documents. Where are they located and is there anything special about deleting them?
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
734
Mar ’21
App Store Connect says my screenshots are not in the RGB color space, but they are
I am trying to add a new screenshot in either the png or jpg format to a product page of an existing app. When I try to reorder the screenshots, App Store Connect says the new screenshot is not in the RGB color space. Preview, which created them, and Finder both say they are in the RGB color space. What should I do?
1
0
960
Feb ’22
When will ScrollView for wkWebView for MacOS be implemented?
I submitted a version of this question 3 years ago. There has not been an answer. 662 developers are watching that question. As requested by KMT I submitted a bug report. Others had submitted a similar bug report before me. As far as I can tell, nothing has been done to address this issue. Not addressing this issue amounts to disturbing negligence. This is important! WebView is flakey. It needs to be replaced. Apple Engineering: Please accept responsibility for this issue and respond with a date when we can expect a solution.
0
0
731
Apr ’22
How to detect an uninitialized NSMutableArray produced by NSKeyedUnarchiver.unarchiveObjectWithData
Using NSDocument.readFromData and NSKeyedUnarchiver.unarchiveObjectWithData, I retrieve an object (of type A) with a property of type NSMutableArray. That array contains a nested chain of objects of type A. The problem object is a child of a child... in that array. I try to do Count on that array and I get an error.
1
0
1.2k
Aug ’22