NSScrollView printing inverted on OSX Mavericks - macos

I have a Mac app that has been on the app store for a few years. It's a time tracking and invoicing app that creates a PDF for the invoice. The PDF is generated from the content of a window in the app that contains the invoice information. Before OSX Mavericks the PDF printed just as it looked like on screen. Unfortunately in Mavericks, the NSScrollView that I am using for the table is printing horizontally inverted.
PDF as it should look, and how it looked on OSX Lion and Mountain Lion:
PDF as it prints out on Mavericks:
When I searched the Google for this problem I did find another person experiencing what seems to be the same problem.
The NSScrollView is nothing fancy, just an NSScrollView with an NSClipView as its contentView, and an NSTableView inside of that.
I'm really hoping that this is a problem that can be fixed, and not just a bug introduced by Mavericks when printing NSScrollViews. Thanks for any help!

Well, I wouldn't say I found a fix for this, but I was able to make this work normally again. I accidentally found that if I put another identical table in the same view hierarchy as the existing one and hid the new table, the first one would print correctly. Don't ask me why it works, because it feels like some serious cargo-culting, but it made the table inversion go away. I hate these kinds of "fixes".

Related

Make VoiceOver announce text pre-10.9

I want VoiceOver to speak some text in an NSTextView that it won't say spontaneously, basically text added programmatically while the view has focus. OS X 10.9 added the NSAccessibilityAnnouncementRequestedNotification API as a way to do this (although it for some reason says macOS 10.7+ on the Apple documentation page), but I want my app to work on 10.7 as well.
EDIT: I made the code using NSAccessibilityAnnouncementRequestedNotification compile and run on 10.7 (by adding a number of missing definitions), but it seems to have no effect prior to 10.9.
I think I've worked out a way to trick VoiceOver into thinking that the text I want it to speak is selected, (basically returning the string and the range I want to be read when asked for the NSAccessibilityAttributedStringForRangeParameterizedAttribute or NSAccessibilitySelectedTextRangeAttribute) and then post a NSAccessibilityValueChangedNotification. This pretty much works, but makes VoiceOver say "Selection Replaced" whenever the user starts typing anything in the text view, on any OS newer than 10.7.
So, my question is: Is there a better way to do what I want?

PDFThumbnailView: Not able to select thumbnails in Sierra for MAC OSx App

I am using PDFKit. Please refer here
PDFThumbnailView does not allow to drag or select the thumbnail after I have updated my Mac OS x to Sierra.
Have already set
[_pdfThumbnailView setPDFView:_pdfView];
and _pdfThumbnailView outlet from xib too.
If works well for previous OS x version.
Any help will be appreciated.
Thanks!!
Apple really screwed PDFKit in MacOS 10.12, among the many other bugs in it, PDFThumbnailView is unusable for the most part, it doesn't do anything except displaying a list of pdf pages (with glitches).
I've spent much time into this but I couldn't find any workaround. I'm afraid your options are either waiting for Apple to fix this (hopefully) or rolling out your own thumbnail view replacement.
Creating your own thumbnail view shouldn't be overly complicated. I'd use NSCollectionView and render the thumbnails into its grid. Then wire all the selection and drag and drop with the PDFView. I'm planning to do exactly this if Apple doesn't fix PDFThumbnailView anytime soon.
(ps: there is a nice tutorial on NSCollectionView on raywenderlich.com )

Develop an iPhoto-like cocoa app for mac OSX

I plan to develop a mac OSX app that has a UI similar to that of iPhoto - a panel on the left and a grid view of images on the right. I am thinking of using NSSplitView to create two panels and using NSCollectionView for the grid.
I guess this must be a pretty popular and common UI pattern for mac apps. I am new to cocoa development. Can anyone with previous experience point me to any related cocoa code samples and design document?
Thanks a lot in advance.
N.B.
This missing piece here is an NSOutlineView in source list mode, put that in your left pane. But otherwise seems like a good place to start.
You might also be interested to see what the developer of Sonora approached this problem; although this is a music app the layout is almost the same.

Fluid swipe and scrolling 10.7 style

I'm looking to add two finger "fluid swiping" to my app. Anyone who has used the week view in the Calendar app that comes with OSX will have seen what I'm trying to do.
I have a scroll view, and I want to be able to use swipe gestures and scrolling to move the content view in the horizontal axis of my NSScrollView, ie a day or a week.
The video from WWDC 2011 titled "Scrolling, Swiping, Dragging: Now with more animation" was quite useful, and looks like it will be able to explain what I want to do, but unfortunately the sample code for PictureSwiper isn't provided with the video.
I'm aware that a newer version of PictureSwiper is avaliable, but it uses NSPageController and I'm really looking for the older Lion 10.7 way of handling things as I can't use NSPageController. Is it still possible to find the old PictureSwiper somewhere?
If not could someone explain how the PictureSwiper sample on Lion worked? I'm aware of the App note https://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKitOlderNotes.html (search for "scrollWheel:") but that has only gone part of the way to explaining the kind of functionality I am after.
Many thanks for any help.
David.
For anyone looking to this for an answer I eventually used one of my "Developer Technical Support" queries that came with my paid Dev account to ask for the old code. A few days latter an Apple engineer emailed me the old Picture Swiper.
Now that I have seen the code the App note makes complete sense! Picture Swiper moves CALayers around, but in my case I just use NSClipView's scrollToPoint:.
Within the scroll handler I just do something like: (gestureAmount * columnWidth) + currentColumnIndexOffset.
Seems to work!

Typing space after NSLog(#" makes the screen scroll down and up

In xcode, when I type
NSLog(#"blarSpace
the screen scrolls down and up. (I'm trying to type out NSLog(#"blar blar");)
However, if I close the quotes first
NSLog(#"")
and then go back and fill in blar blar then all is well.
How do I solve this problem? I'm using 2011 macbook pro and OSX Lion and xCode 4.1.
I dont know But i'm having the same problem in One class if i ever hit space the page try to scroll up and if Im at the bottom of the page it scrolls up and down making a very boring giggle. But wirdly it's bounded to only one class to which i Changed the Name manually... wonder if that can be it.

Resources