Does QLThumbnailImageCreate still support webarchive - quicklook

In the past QLThumbnailImageCreate would return an NSImage from a url pointing to a webarchive. It's not doing so now. Is this a bug, or do I not understand something?

Related

Trying to HideAllOtherApplications in AppDelegate

I have been trying to find a way to hide other applications programmaticly in my AppDelegate. I tried:
func hide() {
NSLog("hide")
NSApplication.hideOtherApplications(self)
}
The error seems to be in the "self". I am pretty sure it is a really simple error but I keep on having issues trying to work it out.
But this does not seem to work. I am new to OS X programming. Although I already worked a bit (just a little bit) with swift.
I guess you are looking for this:
NSWorkspace.sharedWorkspace().hideOtherApplications()
NSApplication.sharedApplication().hideOtherApplications(self)
NSApplication.sharedApplication().unhideAllApplications(self)
There is no unhideAllApplications for NSWorkspace. Please check the reference from Apple website.

ModalViewController in iOS8

I am upgrading old code to latest iOS8, I see lots of this:
if (controller.modalViewController
&& controller.modalViewController.parentViewController == controller)
if(tabcontroller.modalViewController) ....
I see lots of documentation about how to present a modalViewController, but not for when its a property like above code. What's the equivalent of above code in iOS8?
THanks
If you look at the documentation, it says:
modalViewController (iOS 6.0) The controller for the active presented
view'that is, the view that is temporarily displayed on top of the
view managed by the receiver. (read-only)
Deprecation Statement Use presentedViewController instead.
That's probably a good place to start.

Unable to scroll down

I'm struggling on my website which worked well since the shareaholic widget install. I've tried to remove it but the bug remains.
A picture is worth thousand words so it's about : www.mywebshop.org, we can't scroll anymore on the website and I must admit I've never seen that bug (except when using fixed position ;-)).
I'm totally stuck... no cache is active, I can't see anything out of the ordinary... I'm having this issue on every browser on my mac.
Any clues?
Thank in advance ;-)
hey there I have seen your site. Please remove the overflow-y:hidden; from the body selector in the style.css file on line number:2793
That should do it

Display WebArchive from Mail.app and Notes.app

Cocoa's WebView can display .webarchive files. The ones I try to display come from the pasteboard, e.g. when copying parts of a web page in Safari or Mail.app.
The issue I am having is that webarchives from Mail and Notes won't display in a WebView, while webarchives from Safari do.
I looked inside the data of those archives (BBEdit can decypher their binary plist format and show it as XML nicely) and found that the issue is caused by the unusual URL references Mail (and Notes) puts in there:
<key>WebResourceURL</key>
<string>x-msg://4/</string>
If I remove that entry or change it to something using http://, WebView suddenly can display such archives.
Now, how do I solve this in general in my code?
I don't want to have to decode the webarchive, find the WebResourceURL entry and remove it before passing the archive to the WebFrame for loading.
I wonder if there's something else I have to set up with either the WebView or its main frame to make this work.
I noticed that Xcode can show these webarchives just fine, suggesting that Xcode uses WebKit in a more "proper" way that solves the issue. But then, maybe that's just because it has NSWebFrame load the archive from disk, while my code loads it from a CFData object - when loading from a file, WebKit may be using that file URL as the base URL, while it only chokes on it when it doesn't get a usable URL at all.
I have created a little demo project for Xcode here: http://files.tempel.org/Various/Mail-WebArchive-Display-Issue.zip
It includes both an original archive from Mail ("mail-bad.webarchive") and a fixed one ("mail-good.webarchive"), both of which are displayed in two webViews in the demo app.
I had also opened a Tech Support Indident (TSI) with Apple DTS, and the responded that I should file a bug. The bug report can be seen here: http://openradar.appspot.com/radar?id=2843403
After brooding over what Xcode might be doing I found a solution:
This does not work:
WebArchive *archive = [[WebArchive alloc] initWithData:webData];
[[webView mainFrame] loadArchive:archive];
But this does:
[[webView mainFrame] loadData:webData MIMEType:#"application/x-webarchive" textEncodingName:#"" baseURL:NULL];
So, the explicit function to load the archive is faulty while the one that wants an explicit URL, even though I give it none, works.
Go figure.

How to show a html string n uilabel in xcode

When I parse a URL, I'm getting the result in HTML format, so how to load that HTML string in UILabel or UITextView?
I believe this is not applicable for iOS as the AppKit.framework required is only for MacOS development.
Best solution to this problem so far seems to be the DTCoreText class available on GitHub.

Resources