Re: PDFKit on 10.12

2016-10-04 Thread Antonio Nunes
On 04 Oct 2016, at 14:26, Jonathan Mitchell wrote: > > PDFKit seems a bit disturbed on Sierra. > The 10.12 beta 3 seems to improve things but there are still some rendering > stutters etc. 1. Why are you referring to a beta, when 10.12 has been out for weeks now? > Has PDFKit been reworked - t

Understanding accessibility

2016-03-25 Thread Antonio Nunes
I’ve create a custom view controller, and am trying to make it accessible, bot not really getting much luck. The view hierarchy is fairly involved, with multiple levels of stack views and buttons and/or custom views nested within those. From my reading of Apple’s docs on supporting accessibilit

Re: Swift: 'If' statement needing parentheses on closure return value property access?

2015-08-20 Thread Antonio Nunes
it doesn’t really > tell you what’s wrong. In fact, this “consecutive statements” error almost > never gives any help, but I guess the compiler is reluctant just to admit it > has no clue. > > On Aug 18, 2015, at 23:04 , Antonio Nunes wrote: > >>if (r

Swift: 'If' statement needing parentheses on closure return value property access?

2015-08-18 Thread Antonio Nunes
In Swift 2.0 I can write this: repeat { … } while reminder.exclusions.filter { $0.spansTime(t) }.count > 0 but I can’t write this: if reminder.exclusions.filter { $0.spansTime(t) }.count > 0 { … } which gives an erro

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
On 04 Jul 2015, at 22:03, Jens Alfke wrote: > > (Sending a GET request with a body is pretty unusual, but I assume that’s > what the server wants since you say the curl command works…) Yes, I’m not happy about this, and I think this is also what is causing the issue, since it looks like the bo

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
> On 05 Jul 2015, at 00:45, Michael David Crawford wrote: > > Would it work to use libcurl instead? > > I dont know but would be unsurprised were that to be what NSURLRequest > actually does. Probably, but this is on iOS, so I would have to package a libcurl build into the app, adding a few MB

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
Ugh, I’ve corrected the headers. But it doesn’t make a difference regarding the result. -António > On 04 Jul 2015, at 19:04, Rick Mann wrote: > > FWIW, you're setting the Accept header, not Content-Type (nor > Accept-Language). > >> On Jul 4, 2015, at 02:52 , Anto

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
ock wrote: > > >> On 2015 Jul 04, at 02:52, Antonio Nunes wrote: >> >> Is there a way to see exactly what the request looks like when it goes out? > > Search for “OS X Packet Sniffer” and you will find many apps for this, and > even some stuff built into OS X, whic

Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
I have the following curl command to a web api, which retrieves some info: curl -X GET -H 'Authorization: Basic blabla' -H 'Content-Type: application/xml; charset=utf-8' -H 'Accept-Language: en' -d "y...@example.comSomePassWord" 'https://example.com/api/v1/endpoint The -d and xml-string are man

rangeOfString with .RegularExpressionSearch not matching begin and end of line (Swift)

2015-06-12 Thread Antonio Nunes
Hi, I a trying to find a line within a string. When I write: let match = crashReport.rangeOfString("\nIdentifier:.*\n", options: .RegularExpressionSearch) …I get a match. However, when I write let match = crashReport.rangeOfString(“^Identifier:.*$", options: .RegularExpressionSearch) …which

Re: Responsive scrolling: prepareContentInRect: not called

2014-10-08 Thread Antonio Nunes
On 08 Oct 2014, at 01:41, Ken Thomases wrote: >> Wondering if anyone has an idea of why prepareContentInRect: is not called >> for a view when responsive scrolling is enabled. >> >> We are using an NSScrollView subclass that overrides prepareContentInRect:. > > I would not expect -prepareConte

Responsive scrolling: prepareContentInRect: not called

2014-10-07 Thread Antonio Nunes
Hi, Wondering if anyone has an idea of why prepareContentInRect: is not called for a view when responsive scrolling is enabled. We are using an NSScrollView subclass that overrides prepareContentInRect:. When I turn on View Debugging->Show Responsive Scrolling Status during a debug session, th

Re: Autolayoout on scaled views

2014-04-04 Thread Antonio Nunes
by simply setting NSLayoutRelationEqual on NSLayoutAttributeCenterY, as is done for the horizontal centering constraint, still doesn’t work. I still need to manually calculate a margin from the bottom for the vertical centering. - António On 04 Apr 2014, at 16:48, Antonio Nunes wrote: >

Autolayoout on scaled views

2014-04-04 Thread Antonio Nunes
Hi have a view that contains another view. The containerview (parent) can be scaled. The scaling is done by settings scaleUnitSquareToSize to the appropriate value. I’m trying to keep the contained view (subview, or content view) centred in the containerview. When the scale of the containerview

Re: Getting a selection range from a pdfselection...

2014-03-13 Thread Antonio Nunes
On 11 Mar 2014, at 17:37, Matthew Weinstein wrote: > Trying to figure out how to get a pages selection range (offset and length) > for a pdfselection. I've been using the bounding rect, but if I have a > selection that is a sentence that crosses lines and terminates half way in > the last lin

Re: PDFPage init methods not called

2014-02-14 Thread Antonio Nunes
On 14 Feb 2014, at 15:09, jonat...@mugginsoft.com wrote: > PDFPage has two declared initialiser methods: > > - init > - InitWithImage:(NSImage *)image > > When creating a PDFDocument with -initWithURL: neither of the above are > called on my PDFPage subclass. > > A bit of digging reveals that

Re: Creating CGFont from PDF Tf operator

2013-08-27 Thread Antonio Nunes
On 27 Aug, 2013, at 13:46 , Graham Cox wrote: > Parsing a PDF, I need to handle the Tf (set font) operator. The font > situation in PDF files is inordinately complicated, and reading the spec > alone is not really leading to the light-bulb moment. > > Basically, when I get the Tf operator, I n

Re: Decoding images in PDF files

2013-08-26 Thread Antonio Nunes
On 26 Aug, 2013, at 18:49 , Graham Cox wrote: > I'm working on a parser that needs to be able to extract graphics from PDF > files. So far, I'm making good headway with the CGPDFxxx functions. > > I have a question about extracting embedded bitmap images. When I encounter > an XObject stream w

Re: Storing an NSImage File

2013-08-04 Thread Antonio Nunes
On 5 Aug, 2013, at 01:02 , Gordon Apple wrote: > I can¹t find any access to ³pieceInfo² via PDFKit. > > ³PieceInfo² is a standard pdf component, which many companies use for > storage of private date. In this case, the main info I need is to test for > a particular key in the pieceInfo dictiona

Zoom to actual size

2013-07-13 Thread Antonio Nunes
Hi, I'm trying to ensure that when a user elects to zoom the view (in this case a PDFView) to actual size, that it shows the actual size on-screen as best it can. I'm really close, but not quite all the way there. I tested the same function in the Preview app, and there it works perfectly. When

Re: Dynamically change file name extension in NSSavePanel when extension is hidden

2013-07-10 Thread Antonio Nunes
mber numberWithInteger:self.textExportFormat] forKey:ANTextExportFormatKey]; } By setting the desired file type as the only allowable, the save panel now also returns the correct file extension, even if the user chose to hide the extension. If there is a better solution, please tell. -António On 10 Jul,

Dynamically change file name extension in NSSavePanel when extension is hidden

2013-07-10 Thread Antonio Nunes
Hi, I show an NSSavePanel that offers the option to hide the file extension. It also offers the user to switch between saving .txt and .rtf formats. When the user changes the format, the following code is run: - (IBAction)formatForTextExportChanged:(id)sender { self.textExportFormat = [

Re: Failure to create bookmarkData in sandboxed app

2013-05-11 Thread Antonio Nunes
On 11 May, 2013, at 09:50 , Markus Spoettl wrote: >> NSError *error = nil; NSURLBookmarkCreationOptions options = >> NSURLBookmarkCreationSuitableForBookmarkFile | >> NSURLBookmarkCreationWithSecurityScope; NSData *bookmarkData = [self.url >> bookmarkDataWithOptions:options includingResourceValue

Failure to create bookmarkData in sandboxed app

2013-05-10 Thread Antonio Nunes
NSError *error = nil; NSURLBookmarkCreationOptions options = NSURLBookmarkCreationSuitableForBookmarkFile | NSURLBookmarkCreationWithSecurityScope; NSData *bookmarkData = [self.url bookmarkDataWithOptions:options includingResourceValuesForKeys:nil

Re: Find functions disabled while NSSearchField is first responder.

2013-04-28 Thread Antonio Nunes
On 27 Apr, 2013, at 08:04 , Antonio Nunes wrote: > On 25 Apr, 2013, at 18:21 , Antonio Nunes wrote: > >>> I have an NSSearchField, and a menu bar submenu with the standard Find >>> items. When the search field receives some input, it performs its action >>>

Re: Find functions disabled while NSSearchField is first responder.

2013-04-26 Thread Antonio Nunes
On 25 Apr, 2013, at 18:21 , Antonio Nunes wrote: >> I have an NSSearchField, and a menu bar submenu with the standard Find >> items. When the search field receives some input, it performs its action and >> an array controller is filled with search results. Now, while the s

Re: Find functions disabled while NSSearchField is first responder.

2013-04-25 Thread Antonio Nunes
On 24 Apr, 2013, at 21:46 , Antonio Nunes wrote: > I have an NSSearchField, and a menu bar submenu with the standard Find items. > When the search field receives some input, it performs its action and an > array controller is filled with search results. Now, while the search field

Find functions disabled while NSSearchField is first responder.

2013-04-24 Thread Antonio Nunes
Hi, I have an NSSearchField, and a menu bar submenu with the standard Find items. When the search field receives some input, it performs its action and an array controller is filled with search results. Now, while the search field is the first responder, none of the Find items are enabled, so i

Showing a drawer on a sheet

2013-04-19 Thread Antonio Nunes
Hi, I have a panel that is shown as a sheet on the document window. I'm trying to show a drawer (NSDrawer) when a certain tab is selected. The drawer shows, but behind the main document window, rather than in front of it, thus being either partly or completely obscured. The drawer window level

Re: BAse localisation and strings files compatibility with 10.7

2012-12-31 Thread Antonio Nunes
On 30 Dec, 2012, at 23:09 , Antonio Nunes wrote: > I'm considering moving (part of) an existing project to using a base > localisation, with nibs only for the base language, and strings files to > localise for other languages. I can't find in the documentation whether

BAse localisation and strings files compatibility with 10.7

2012-12-30 Thread Antonio Nunes
I'm considering moving (part of) an existing project to using a base localisation, with nibs only for the base language, and strings files to localise for other languages. I can't find in the documentation whether this feature is compatible with 10.7. I think it is, but I'm not sure, and can't

Re: Window resizing autolayout?

2012-12-24 Thread Antonio Nunes
On 24 Dec, 2012, at 11:22 , Antonio Nunes wrote: >> It seems to me that changing the UI elements in awakeFromNib probably isn't >> enough, since that doesn't tell the layout system that something has >> changed. Anyway, these documents try to explain the c

Re: Window resizing autolayout?

2012-12-24 Thread Antonio Nunes
On 24 Dec, 2012, at 08:25 , Quincey Morris wrote: > On Dec 23, 2012, at 22:44 , Antonio Nunes wrote: > >> Currently, in awakeFromNib, I adjust all user facing interface elements to >> the target language, and I had hoped that with wider, and sometimes higher >>

Re: Window resizing autolayout?

2012-12-24 Thread Antonio Nunes
On 24 Dec, 2012, at 08:28 , Kyle Sluder wrote: > Changing the text of a label will cause it to call [self > invalidateIntrinsicContentSize], which will ensure a layout pass happens > on the next window update. > > My hunch is that NSPopover manually manages the size of its window to > match is c

Window resizing autolayout?

2012-12-23 Thread Antonio Nunes
I asked this question a little while back, but probably not in a clear or smart way. I hope I can explain what I need better this time. In the process of localising my app, i find that I need some sheets and some popovers to have different sizes, depending on the user's chosen language. Mostly,

Auto Layout, Localization and Superview Size

2012-12-19 Thread Antonio Nunes
I'm having trouble implementing auto layout based views that appear in popups and open/save panels. Due to increased verbosity, relative to the original English, in for some localizations some views need to grow in size to fit their content. Currently, if I create a NIB in IB (Xcode 4.5), and t

PDFActionRemoteGoTo won't save?

2012-12-03 Thread Antonio Nunes
Hi, I want to create, use and save PDFActionRemoteGoTo objects. Creating them, adding them to a PDFPage and using them in a PDFView works just fine. However when I save the document, the console logs a warning: "NEED TO ADD PARTIAL FILE PATH", and the action is not saved with the document. Look

Re: Mystifying index out of bounds error

2012-11-01 Thread Antonio Nunes
On 1 Nov, 2012, at 15:50 , Mike Abdullah wrote: > Well it all looks like your code shouldn't be able to give the above > exception. To check, there's no other calls to -characterAtIndex: in the code > you omitted? And the code you pasted is from ANBorderedTextView? No other calls to characterA

Re: Mystifying index out of bounds error

2012-11-01 Thread Antonio Nunes
f8a86fcb6 NSApplicationMain + 869 9 PDF Nomad 0x0001036e6f84 PDF Nomad + 8068 ) Unfortunately, I did not receive a full crash report, so I can't show register contents. -António > On 1 Nov 2012, at 12:11, Antonio Nunes wrote: > >> Hi, >

Mystifying index out of bounds error

2012-11-01 Thread Antonio Nunes
Hi, I have this code in my app: - (void)keyDown:(NSEvent *)theEvent { unichar oneChar; NSString*theChars = [theEvent charactersIgnoringModifiers]; if ( 0 == theChars.length ) { return; } oneChar = [theChars

Re: variable problem is driving me nuts

2012-10-28 Thread Antonio Nunes
On 28 Oct, 2012, at 12:50 , H Miersch wrote: > ok, it looks like i've sorted the original problem. but here's the next one: > > i have this line: > > for (i = 0; i++; i < count) {…} > > in the app delegate. Xcode keeps giving me this warning: expression result > unused. WTF? that is correct s

Re: Prevent display of PDF controls in a WebView

2012-09-02 Thread Antonio Nunes
On 2 Sep 2012, at 18:32, Phillip Mills wrote: > In an OSX application, I use a WebView to display a variety of file types. > When the type is PDF, something within Cocoa (PDFKit?) intercepts mouse > movement in the lower portion of the screen and responds by displaying a > translucent gray vie

Re: How to sandbox an included framework

2012-08-16 Thread Antonio Nunes
On 16 Aug 2012, at 07:34, Mike Abdullah wrote: > > On 15 Aug 2012, at 18:48, Antonio Nunes wrote: > >> After a number of successful submissions of my sandboxed app tot he App >> Store, today Apple decided to reject my app because one of the 3rd party >> frame

Re: How to sandbox an included framework

2012-08-16 Thread Antonio Nunes
On 16 Aug 2012, at 07:34, Mike Abdullah wrote: Thanks for your thoughts Mike. I think they confirm my notion that this rejection was in error (either that, or I'm misunderstanding something): > On 15 Aug 2012, at 18:48, Antonio Nunes wrote: > >> After a number of successful

How to sandbox an included framework

2012-08-15 Thread Antonio Nunes
After a number of successful submissions of my sandboxed app tot he App Store, today Apple decided to reject my app because one of the 3rd party frameworks it includes and links against is not sandboxed. I don't recall hearing about sandboxing frameworks separately. I know they need to be codesi

Re: setting selection in PDFView

2012-07-20 Thread Antonio Nunes
On 20 Jul 2012, at 18:26, Martin Hewitson wrote: >>> In my app I have a user action which allows them to select a particular >>> line in a PDFView. The relevant method (on my PDFView subclass) looks like >>> this. >>> >>> - (void)displayLineAtPoint:(NSPoint)point >>> inPageAtIndex:(NSUInteger)

Re: PDFView not displaying properly/immediately

2012-06-26 Thread Antonio Nunes
On 26 Jun 2012, at 08:42, Martin Hewitson wrote: > In recent builds of my LaTeX editor app, the PDFView just displays white > blank pages on first load. After scrolling a little or zooming in or out the > PDF is properly displayed. I even get cases where only half of the page is > rendered unti

Re: More PDFView mysteries...

2012-06-15 Thread Antonio Nunes
On 15 Jun 2012, at 16:58, Scott Ribe wrote: >> Indeed, the only way I found to solve this is to build in 10.7.3, but >> according to my tests the issue only happens when you've attached a >> PDFThumbnailView to the PDFView. I believe otherwise the crash on close >> doesn't happen. > > I'm buil

Re: More PDFView mysteries...

2012-06-15 Thread Antonio Nunes
On 15 Jun 2012, at 16:20, Scott Ribe wrote: >>> Ideas? Anyone else having pdfview lion problems. >> >> Yes, the problem you described, plus also fairly frequently crashes on >> closing the window--looks like invalidate being sent to a timer that no >> longer exists, when my window controller do

Re: Proper place to post on 10.8 SDK?

2012-06-11 Thread Antonio Nunes
On 11 Jun 2012, at 17:50, livinginlosange...@mac.com wrote: > Where could I post questions regarding the 10.8 SDK? Is that on the apple > developer website? devforums.apple.com -António I try to take one day at a time, but sometimes, several days at

Re: How to know if a file has been opened before?

2012-06-06 Thread Antonio Nunes
On 5 Jun 2012, at 14:45, Stephen J. Butler wrote: > On Tue, Jun 5, 2012 at 3:14 AM, Antonio Nunes > wrote: >> On 5 Jun 2012, at 00:09, Stephen J. Butler wrote: >> >>> You can use extended attributes to attach information to a file. Maybe >>> serialize y

Re: How to know if a file has been opened before?

2012-06-05 Thread Antonio Nunes
On 5 Jun 2012, at 00:09, Stephen J. Butler wrote: > You can use extended attributes to attach information to a file. Maybe > serialize your session state as a plist and use setxattr/getxattr to > manipulate it. Follows the file as it's moved around. Thanks Stephen, I think the extended attribute

How to know if a file has been opened before?

2012-06-04 Thread Antonio Nunes
I have implemented window state restauration in an app. This works fine for re-opening documents that were open when the app was last quit. What I now want to do is extend that functionality to files that were not necessarily open when the app was last quit, but simply that have been opened at a

Re: @synchronized crashing with ARC

2012-05-31 Thread Antonio Nunes
On 1 Jun 2012, at 02:34, Charles Srstka wrote: > static dispatch_once_t onceToken; > dispatch_once(&onceToken, ^{ > myVLFContext = [[VLFContext alloc] init]; > }); > > @synchronized(myVLFContext) { > ... > } That does seem better. Any reason though to create a custom class? Couldn't

Re: @synchronized crashing with ARC

2012-05-31 Thread Antonio Nunes
On 31 May 2012, at 17:00, Jens Alfke wrote: > Huh? I thought the parameter to @synchronized(…) had to be an object > reference? Well, yes, but my understanding was/is that it was essentially about the pointer, and this formula worked just fine until I migrated to ARC. I think Scott is right th

Re: @synchronized crashing with ARC

2012-05-31 Thread Antonio Nunes
o do a bit of memory management on your > context pointer and the calls it expects aren't there. Ok, that seems to make sense. At any rate, changing kMyVLFContext to a more regular style (an NSString) seems to fix the issue. static NSString *kMyVLFContext = @"kMyVLFContext"; Thanks, A

@synchronized crashing with ARC

2012-05-31 Thread Antonio Nunes
I have a function that looks essentially like this: static void *kMyVLFContext = &kMyVLFContext; Boolean myFunction(CFURLRef path) { CFDictionaryRef myDictionary = NULL; @synchronized(kMyVLFContext) { … work … } return myDictionary != NULL

Re: PDFThumbnailView Problem (kind of)

2012-05-22 Thread Antonio Nunes
On 23 May 2012, at 03:53, Matthew Weinstein wrote: > I have a typical thumbnailview on a drawer and a pdfview in main window. I > have a category that lets me drag and drop a pdf onto the pdfview; it then > gets the url and sets a pdfdocument to that url; sets the pdfview and sets > the thumbna

Re: Layout constraint related exceptions

2012-05-16 Thread Antonio Nunes
I should add that all the reports I have received come from 10.7.4 systems, so it looks like 10.7.4 may have introduced a new issue in the auto layout system. This would also explain why the issue did not come up until a few days ago. -António On 16 May 2012, at 07:02, Antonio Nunes wrote

Layout constraint related exceptions

2012-05-15 Thread Antonio Nunes
I have an app whose current version has been out for over a month. Now, since yesterday I received 6 layout constraint related exception reports (from 6 different users) with the signature shown below. I find that a bit strange, since layout constraints are not date/time based, so why would th

Re: self.myTextField.stringValue = @"" fails

2012-05-09 Thread Antonio Nunes
On 9 May 2012, at 19:55, Corbin Dunn wrote: >> , so probably that is causing the issue then. To make it possible to have an >> empty text field when there are no pages in the document I changed the >> symbol for 0: >> [self.toolbarPageNumberTextField.formatter setZeroSymbol:@""]; (I did >>

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
On 8 May 2012, at 23:10, Corbin Dunn wrote: > > On May 8, 2012, at 1:35 PM, Antonio Nunes wrote: > >> On 8 May 2012, at 21:46, Andy Lee wrote: >> >>> Bizarre indeed. Out of curiosity, are you using ARC? Maybe the compiler is >>> confusedly zeroing a non

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
On 8 May 2012, at 21:46, Andy Lee wrote: > Bizarre indeed. Out of curiosity, are you using ARC? Maybe the compiler is > confusedly zeroing a non-weak pointer. I'm *really* grasping at straws, > though. No ARC. No garbage collection either. > Are there any bindings on the text field? Again, I d

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
On 8 May 2012, at 19:01, Jens Alfke wrote: > On May 8, 2012, at 9:15 AM, Antonio Nunes wrote: > >> I have a text field that when I try to set it to a literal string fails: >> This is the code: >> self.myTextField.stringValue = @""; (It also fails if t

self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
Hi, I have a text field that when I try to set it to a literal string fails: This is the code: self.myTextField.stringValue = @""; (It also fails if the literal string is not empty). This is the (partial) backtrace: 2012-05-08 18:09:28.516 MyApp[18775:507] *** Assertion failure in -[NSTextFiel

Re: PDFKit: translate point coordinates from view coordinates into page coordinates

2012-03-27 Thread Antonio Nunes
On 27 Mar 2012, at 12:19, Nick wrote: > I would like to place a PDFAnnotation onto a PDF page in a place where > the user clicked with the mouse. [...] > NSPoint locationInView = [self convertPoint:[theEvent > locationInWindow] fromView:[[self window] contentView]]; You are receiving the event lo

Re: Disable PDFView context menu

2012-03-26 Thread Antonio Nunes
On 26 Mar 2012, at 19:09, Nick wrote: > However, I still can't receive -rightMouseDown message. I am returning > "nil" in the method -(NSMenu*)menuForEvent, which disabled the context > menu. > But how can I process right-mouse-button clicks?.. PDFView doesn't play very nice with clicks. If you a

Re: Blocks: object retaining behavior?

2012-03-14 Thread Antonio Nunes
On 14 Mar 2012, at 16:48, Jens Alfke wrote: >> My assumption is that the savePanel will be held on by the block for as long >> as it exists. But now I wonder whether that assumption is correct, and this >> retaining/copying behaviour only happens when the block is copied. > > True, ‘savePanel’

Blocks: object retaining behavior?

2012-03-14 Thread Antonio Nunes
Hi, I'm tracking down the cause of a crash, and am starting to wonder whether my understanding of what gets retained by a block is correct. Lets say that we have the following method: [savePanel beginSheetModalForWindow:self.windowForSheet compl

Re: Forcing subclass creation through method swizzling not airtight?

2012-03-12 Thread Antonio Nunes
On 12 Mar 2012, at 16:57, Greg Parker wrote: > On Mar 10, 2012, at 11:05 PM, Antonio Nunes wrote: >> In the latest public release of my software, I used method swizzling to >> force creation of my subclass when the system tries to create instances of >> its superclass. How

Re: Forcing subclass creation through method swizzling not airtight?

2012-03-11 Thread Antonio Nunes
On 11 Mar 2012, at 09:48, Jean-Daniel Dupas wrote: > +initialize is not call until you try to use your class. > So there is no garantee it will be call at all, Thanks Jean-Daniel, I think I can be pretty confident it is called, since this initialize is in my NSApplication subclass. Should be ca

Forcing subclass creation through method swizzling not airtight?

2012-03-10 Thread Antonio Nunes
In the latest public release of my software, I used method swizzling to force creation of my subclass when the system tries to create instances of its superclass. However, I have received a very few reports where apparently instances of the superclass are still created, and wreak havoc (i.e. the

Re: Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-24 Thread Antonio Nunes
On 24 Feb 2012, at 16:55, Corbin Dunn wrote: >> I have a few popovers that, as far as I'm aware of, were working fine up to >> 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it >> often disappears, whether the click is on the background or on a UI item. I >> haven't f

Re: Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-24 Thread Antonio Nunes
On 23 Feb 2012, at 21:52, Seth Willits wrote: >> I have a few popovers that, as far as I'm aware of, were working fine up to >> 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it >> often disappears, whether the click is on the background or on a UI item. > > Can you r

Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-23 Thread Antonio Nunes
I have a few popovers that, as far as I'm aware of, were working fine up to 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it often disappears, whether the click is on the background or on a UI item. I haven't figured out the trick exactly of the way in which clicking

Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-23 Thread Antonio Nunes
I have a few popovers that, as far as I'm aware of, were working fine up to 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it often disappears, whether the click is on the background or on a UI item. I haven't figured out the trick exactly of the way in which clicking

Re: Core Audio Help

2011-12-23 Thread Antonio Nunes
On 23 Dec 2011, at 18:44, Phil Hystad wrote: > Yes, I know of that "promised" book. It seems to have been in the works for > a long time. I just checked Amazon and it says April 2012. Well, I think I > have seen such a release date before but it was probably a year or two ago. Go to Safari b

Re: Prevent side subviews of NSSplitView from resizing during window zoom

2011-10-28 Thread Antonio Nunes
On 26 Oct 2011, at 17:46, Antonio Nunes wrote: > I use an NSSPlitView with three subviews. The general idea is that when the > window is resized, only the middle view resizes. I have this working just > fine when dragging the window frame. The split view consults the delegat

Prevent side subviews of NSSplitView from resizing during window zoom

2011-10-28 Thread Antonio Nunes
I use an NSSPlitView with three subviews. The general idea is that when the window is resized, only the middle view resizes. I have this working just fine when dragging the window frame. The split view consults the delegate with splitView:shouldAdjustSizeOfSubview:, and I return YES when the sub

Re: Exception when entering too big value in text field (with number formatter)

2011-10-23 Thread Antonio Nunes
nt to put up an alert and that appears to cause issues if the text field lives in a popover. I created a minimal project exhibiting the issue, and will submit it to the bug reporter. -António On 22 Oct 2011, at 07:27, Antonio Nunes wrote: > On 21 Oct 2011, at 17:23, Nick Zitzmann wrote: >

Re: Exception when entering too big value in text field (with number formatter)

2011-10-21 Thread Antonio Nunes
On 21 Oct 2011, at 17:23, Nick Zitzmann wrote: >> 2011-10-21 11:49:49.520 AwesomeApp[35994:707] -[NSPopoverFrame >> titlebarRect]: unrecognized selector sent to instance 0x1050e7a30 > > …often happens when an object was deallocated, and then some other object was > allocated in its place, and t

Exception when entering too big value in text field (with number formatter)

2011-10-21 Thread Antonio Nunes
Hi, I have an NSTextField with a number formatter and an NSStepper in a view that is used in an NSPopover. The values of both interface items are bound to an ivar of the view controller via an object controller. Both the text field and the stepper have a max value of 9. When I enter a valu

Re: Knowing when font panel is visible

2011-09-04 Thread Antonio Nunes
On 4 Sep 2011, at 10:39, Quincey Morris wrote: > On Sep 4, 2011, at 00:40 , Antonio Nunes wrote: > >> I have a control that needs to be highlighted when the font panel is >> visible. This turns out not to be an easy task. I can't find any >> notifications that w

Re: Knowing when font panel is visible

2011-09-04 Thread Antonio Nunes
On 4 Sep 2011, at 11:05, jonat...@mugginsoft.com wrote: > FWIW On OS X 10.7.1 I couldn't successfully change the font panel class > either. Hm, probably time for a trip to the BugReporter. -António There is a world of difference between sear

Re: Knowing when font panel is visible

2011-09-04 Thread Antonio Nunes
On 4 Sep 2011, at 10:39, Quincey Morris wrote: >> I have a control that needs to be highlighted when the font panel is >> visible. This turns out not to be an easy task. I can't find any >> notifications that will be triggered whenever the font panel is shown or is >> hidden. > > Why can't you

Re: Knowing when font panel is visible

2011-09-04 Thread Antonio Nunes
On 4 Sep 2011, at 10:39, Quincey Morris wrote: >> I have a control that needs to be highlighted when the font panel is >> visible. This turns out not to be an easy task. I can't find any >> notifications that will be triggered whenever the font panel is shown or is >> hidden. > > Why can't yo

Knowing when font panel is visible

2011-09-04 Thread Antonio Nunes
Hi, I have a control that needs to be highlighted when the font panel is visible. This turns out not to be an easy task. I can't find any notifications that will be triggered whenever the font panel is shown or is hidden. windowDidUpdate: might do for discovering that the window is or has becom

Re: Animating NSSplitPane position

2011-06-15 Thread Antonio Nunes
On 16 Jun 2011, at 03:48, Graham Cox wrote: > I'm using -setPosition:ofDividerAtIndex: and I call this using the view's > animator: > > [[mySplitPane animator] setPosition:position ofDividerAtIndex:0]; > > But it doesn't animate and just jumps into position. I see other apps manage > thi

Animated Split View

2011-06-01 Thread Antonio Nunes
Hi, I want a generic animated split view. So I had a rummage online, and couldn't find anyone who had prepared the wheel for me. Consequently I set out to create my own. I soon found that overriding setPosition:ofDividerAtIndex: and make it work correctly for split views with more than two vie

Re: How to use PDFAnnotationStamp?

2011-05-23 Thread Antonio Nunes
On 23 May 2011, at 19:26, Laurent Daudelin wrote: > I've been trying to use class "PDFAnnotationStamp" but it seems it's missing > something. Its superclass "PDFAnnotation" has a method called > "hasAppearanceStream" but there doesn't seem to be any way to set the > appearance stream, in "PDFAn

Re: PDFDocument and CGPDFDocument

2011-05-11 Thread Antonio Nunes
On 11 May 2011, at 03:59, Graham Cox wrote: > Are CGPDFDocument and PDFDocument toll-free bridged? If not, how can I get a > PDFDocument from a CGPDFDocumentRef? They are not toll-free bridged. > I need to use the lower level API to extract graphic entities from a PDF, but > I'd like to use P

Saving NSDocument concurrently

2010-12-24 Thread Antonio Nunes
Hi, Since saving a document can be a lengthy process in one of my apps, I am switching it to a concurrent thread. My idea is to do the following: - (void)saveToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSave

Re: System resources and number of operations on an NSOperationQueue

2010-11-14 Thread Antonio Nunes
On 14 Nov 2010, at 16:25, Ken Thomases wrote: > The system can't predict the future. When an operation is pending in a > queue, there's no way for the system to know if it's going to be CPU > intensive, memory intensive, and/or I/O intensive. > > Let's suppose the system primarily governs its

Re: System resources and number of operations on an NSOperationQueue

2010-11-14 Thread Antonio Nunes
On 14 Nov 2010, at 16:16, James Bucanek wrote: > NSOperationQueue uses Grand Central Dispatch, which will attempt to > load-balance the number of running operations based on _CPU_ resources. > However, that doesn't mean GCD will (or even can) automatically find the most > efficient run schedule

System resources and number of operations on an NSOperationQueue

2010-11-14 Thread Antonio Nunes
I'm developing a daemon to run tasks as files get dropped into a folder. When a new file is detected, a new operation gets put onto the daemon's operation queue. The operation launches a task and waits for it to finish, then the operation exits. The issue I am seeing is that the operation queue

Re: What's the point of @properties?

2010-09-20 Thread Antonio Nunes
On 20 Sep 2010, at 20:00, Kyle Sluder wrote: > Did you mean "synthesized ivars"? It is important you be precise. Yes that is what I meant. > Automatically showing synthesized properties—or any properties at > all—would be a bad idea, because methods have side effects, and even > calling simple a

Re: What's the point of @properties?

2010-09-20 Thread Antonio Nunes
On 20 Sep 2010, at 19:27, Seth Willits wrote: > And Chris explained that properties don't necessarily *have* ivars for you to > look at anyway. If you want to see its value, then you need to run the > print/po command on the gdb command line. Fair enough. And what I would like to see, is the de

Re: What's the point of @properties?

2010-09-20 Thread Antonio Nunes
On 20 Sep 2010, at 11:47, Chris Hanson wrote: > GDB doesn’t support dot syntax for invoking property getters, so you just > need to use bracket syntax when doing it: Maybe Stefan meant rather that the ivars do not show up in the debugger window. It's a real pain to have to go to the console eve

Re: Notification of file system modification arrives too early?

2010-05-30 Thread Antonio Nunes
On 30 May 2010, at 17:51, Jens Alfke wrote: >> When a change occurs, I attempt to open the file using the FS API specifying >> exclusive read + exclusive write access. If it fails, it's likely because >> some other process still has the file open. I delay a half second or so and >> try again.

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Antonio Nunes
On 28 May 2010, at 12:07, Uli Kusterer wrote: > Are you doing this for Finder-originated copying only? In this case, you > could probably look at the file's OSType/creator. I believe they get set to > some special "busy"-values during copying, so if you get a write notification > and your file

  1   2   >