How to show document preview in iCloud conflicts sheet in Mac App using NSDocument - conflict

I am creating a Mac App, using NSDocument, that stores a custom class of documents to iCloud.
I was able to get the program to store documents to iCloud quite easily by just Code Signing it, Sandboxing it, and adding iCloud entitlements; however, I'm still encountering a problem where when I trigger an iCloud conflict and the program drops down the sheet allowing the user to resolve the conflict the rows in the sheet do not show the small image of the document (like Preview and TextEdit do).
Additionally, when I click on the area where the image should be (it's blank) it opens up a Quick Look window that just displays an image of the Document Icon together with some other information as opposed to a snap shot of the actual file like Preview and TextEdit do.
I have not found any information in Apple's documentation that explains what I need to do to implement the same behaviour as Preview and TextEdit.
So far I've been surprised by how easily I've been able to get all of the functionability of not only the Auto Saves and the Versions browser, but also saving to the Cloud. NSDocument seems to do all of this for the developer (resolving iCloud Conflicts, etc.), as Apple's documents says it does, but again I'm not getting this other behaviour and I don't want to reinvent the wheel by writing code that is not needed.
I'm thinking that the answer might lie somewhere with implementing a Quick Look thumbnail (for the small image in the table in the sheet) and a Quick Look preview for the larger preview of the document when that in the sheet is clicked on, but this seems like a lot of work and I'm afraid of losing some of the other build-in functions of NSDocument if I start "trapping" NSDocument routines up the food chain so to speak.
Has anyone else encountered this problem and found the easiest solution?
Update: Dec. 25/12
I've finally figured out that the problem is I need a QuickLook generator to display both a QL Thumbnail (which shows up in the table in the conflicts sheet) and a QL Preview (which is displayed when a user clicks on the Thumbnail)
I ended up creating the QL generator project, and afterwards creating a workspace which I added my main project and the QL generator project to. After that I added a Copy Files Build Phase to the main project to copy the QL generator into the main Application bundle.

Related

Creating a Record Option on a PDF or Word Document

I am going to preface this with the question on a more general scale then go on to explain my specific issue.
Is there a way to create a word document, pdf, or anything comparable that I could add a "Record Audio" button to that would save the audio with the file as well as all the other info that might on a pdf/word form?
I know that Adobe Pro has a leave audio comment option, but I am creating this for a user and I do not want them to have to use that. The reason I need this is that I currently have a form usually gets partially filled out and then passed on with a dictation that needs to be transcribed at a later time. I am aiming to do this so that I can have the form and audio file linked and saved under one file.
If there is a way to leave the audio comment on a pdf with some javascript that is triggered by a button, I am perfectly okay with that I just have no clue how to program that (in terms of syntax, I am comfortable programming that isn't the problem lol).
I am also open to forms of documents other than pdf or word. I only mentioned these as they are the industry standard, but if there is another file type that would work around this, I am more than glad to use it!
I am using word 2013 by the way.
Thanks in advance!
You could write a TaskPane Addin that shows the audio controls. Once the recording is complete, the audio could be saved in the CustomXML parts in the document.
Then other users who receive the document and have your AddIn, will be able to listen to the recording.
I have not verified it in-depth, but it would be possible to add a button to the PDF file which creates a Sound annotation. The user should be then automatically asked (via a dialog) to record it.

Print preview of my web page to pdf and save it on server side programmatically

I have a deceitfully difficult problem which I had thought it was easy one at the beginning and yet I have spent more than 3 days on and off in total.
what I simply need to do is to save the print preview of the page to PDF file on server side from code behind initiating by a button click.
I was expecting using an open source and then I thought there would be a code like xyzopencode.savepasgeaspdf(path) but I could not find it. I got really close to solution by saving the PDF but then I realized it did not save the picture it only saved the strings.
I tried the pdfsharp but as long as I see it draws the whole thing from scratch and I am nor sure if I can do it.
The reason I need picture compatible one is I have 3rd party signature controller on my page and my couple of attempts worked without them or any picture but when I added pictures they failed to show to picture or did not create the PDF at all. The perfect solution would be just saving what ever shows up in the print preview as PDF, just like the built in feature of Google chrome (but on server side).

Changing OS file icons using AIR app

I am building an AIR app which will be kind of like Dropbox. It will allow users to sync their files between various OSs. What I would like to know is that how can i change the default file system's file icons (add an overlay for eg) for states like - Synced and Syncing, the way Dropbox does it ??
On Windows i found out that Dropbox edits the registry files to insert the overlay icons..not yet sure how they do it in MAC OS X though.
I saw some threads here asking similar questions about AIR, but none referencing how to change file's icons. Hoping to get a solution for this from the various experts .. Please suggest any ideas if you know how it can be accomplished. Much thanks.
A simple yet effective solution would be to use icons that are only internal to your application : just embed in your application files some transparent pictures representing the various states of your files (with only the small part telling in which state it is, with the rest totally transparent), that you will add at runtime above the displayed icons.
Since you can get the actual icon of your files, just draw them into a BitmapData (if needed) & add an overlay with theses custom images, using the one related to your file's state in your application.
And one step further could be to store in your AIR application folder any resulting icons for future use (check what types of files you already have, and if your new file type isn't in thoses, export the various icons with your custom overlays to PNG files directly on the user device, for re-loading them the next time the application is opened).

iTunes Connect sends email about a issue with icon file, how to fix?

This is the email:
Dear developer,
We have discovered one or more issues with your recent binary submission for "Bla". Before your app can be reviewed, the following issues must be corrected:
Corrupt Icon File - The icon file 72 x 72.png appears to be corrupt.
Once these issues have been corrected , go to the Version Details page and click Ready to Upload Binary. Continue through the submission process until the app status is Waiting for Upload and then use Application Loader to upload the corrected binary.
I have change the file and re-upload the app, but I got the email again.
As Michael Dautermanm says.
Make sure "compress png's" is turned off in the build settings.
thanks
Can you open the file in Preview, and choose 'Tools' -> 'Show Inspector'? The file may be using some PNG format features that Apple don't like. They want RGB, 8 bit depth, no alpha. See the Custom Icon and Image Creation Guidelines.
For comparison, here are screenshots of the Preview Inspector, showing properties of an icon for an app that was accepted. If you're unsure, post similar screenshots for the properties of your picture.
The "Pixels Per Meter" part may or may not appear. It wasn't there when I first opened some icon files five minutes ago, and now it appears for every PNG I open. Weird.
Edit: also check the icon entries in your 'Info.plist', or the 'Info' tab for your Target. (These are not the same thing, as I just spent several hours discovering. Settings in the 'Info' tab override your 'Info.plist'.) As of the iOS 5.1 SDK, these include Icon file (a string), Icon files (an array), and Icon files (iOS 5) (a dictionary containing at least one dictionary containing an array). XCode seems to add your launch images to this list too. Don't rely on it to keep the list tidy - I have sometimes found outdated filenames in mine.
For further comparison, here's what ended up in the Info.plist of a valid app. Your filenames may be different, as long as they match the resources in your project.
I'm the developer of the app Pillboxie. I have been having the same issue as you, but I believe I may have finally found a solution.
Before proceeding with my suggestion, make sure that your Info.plist and all icon filenames appear exactly as Apple requires. Keep checking the documentation to make sure you're up-to-date, but Dondragmer's recommendation looks correct to me.
I created all my image resources, including app icons, in Photoshop, exporting for web as PNG-24's. Because Pillboxie has numerous images, setting "Compress png's" to YES in the build settings helps me save several megabytes of space. I was getting the same error as you until I tried turning off this compression, as Evaristoyok suggests. However, my app jumped up several mb. I hoped to find a better way.
Tonight I found the following link: article. In it the author suggests to make sure that "Interlaced" is NOT selected in Photoshop when exporting images in the Save For Web & Devices dialog window. I re-exported all icon and launch images with this disabled, and it solved my issue. I was able to submit my app and still leave png compression enabled.

Retrieving Spotlight query used to open document in application

If you search for something that opens Preview.app (e.g. a PDF file) in Spotlight, the application not only opens the file but actually copies the Spotlight query into the application's search field (for deeper search). iPhoto and Mail.app also do this.
This is a really nice feature. Unfortunately, Apple does not document how it's implemented. Opening a document from Spotlight appears to simply send application:openFile to the application delegate. Is it possible to retrieve the user's Spotlight query somehow? Or is this a hardcoded feature of Spotlight?
If you're looking for the term used in the query, keyAESearchText will work (see listing 10-1). So yes, they document it, but not in the expected place. File an enhancement request at the bottom of the page.