Re: Observing with GC

2008-02-27 Thread Antonio Nunes
On Feb 26, 2008, at 11:42 AM, Chris Suter wrote: On a side note, it doesn't look like you have to call removeObserver: for notifications registered with NSNotificationCenter. The garbage collection docs state: For example, a notification center should not form strong relationships to

Re: Help with PDFPage to NSImage

2008-02-27 Thread Antonio Nunes
On Feb 27, 2008, at 10:32 AM, Florian Soenens wrote: i don't understand why this simple code is not working: PDFDocument *pdfDocument = [[PDFDocument alloc] initWithURL:inputurl]; PDFPage *currentPage = [pdfDocument pageAtIndex:i]; NSImage *image = [[NSImage alloc] initWithData:[currentPage

Re: Help with PDFPage to NSImage

2008-02-27 Thread Antonio Nunes
On Feb 27, 2008, at 1:45 PM, Florian Soenens wrote: The source pdf does display correctly in Preview and i'm using Leopard. Here's my output: 2008-02-27 13:42:14.710 ThumbNailFixedWidthLine[26446:10b] _NXCreateWindow: error setting window property (1002) 2008-02-27 13:42:14.910

Re: NSURLConnection failing [SOLVED]

2008-03-20 Thread Antonio Nunes
On Feb 26, 2008, at 9:14 PM, Nir Soffer wrote: Turns out garbage collection was doing me in. When the NSURLConnection object was hanging out waiting for a response, it would get collected. To work around this, after creating the NSURLConnection object I just stick it in a NSMutableSet. When

Re: Why must this be an element?

2008-04-05 Thread Antonio Nunes
Sorry, posted to the wrong list. António On Apr 5, 2008, at 8:30 AM, Antonio Nunes wrote: On Apr 5, 2008, at 2:04 AM, Christiaan Hofman wrote: Note that if your -objectSpecifier implementation returns an NSUniqueIDSepcifier, then 1. […] 2. the container must implement

Re: PDFView and Core Data undos

2008-04-08 Thread Antonio Nunes
On Apr 8, 2008, at 10:19 PM, Justin Hawkwood wrote: How do I call [myPDFView setDocument:previewPDF] without clearing out the undoManager? I don't think you can. (And if you can, I'd really, really like to know :-) I filed a bug report on this back in Feb. (#5733716). António

[ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Antonio Nunes
Hi, I've put together a simple wrapper to easily change the system sound volume using Objective-C, obviating the need to deal directly with lower-level CoreAudio calls. The files are available here: http://sintraworks.com/media/code/ANSystemSoundWrapper.zip The wrapper consists of a

Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Antonio Nunes
On Apr 16, 2008, at 9:06 AM, Jean-Daniel Dupas wrote: I don't want to start another Code design war, but just wonder if doing Utility Class is a common practice in obj-c. Unlike Java or other object oriented language, obj-c is a superset of C and support simple functions. Wouldn't it be

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Antonio Nunes
On Apr 21, 2008, at 4:55 PM, Kevin Grant wrote: Is the view drawing on a thread other than the main thread? That might not be allowed (I'm not sure about Cocoa...in Carbon this was never possible). No, it all happens on the main thread. For the doesNotRecognizeSelector case, do you see any

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Antonio Nunes
On Apr 21, 2008, at 5:52 PM, Quincey Morris wrote: If d is a local variable, as this code fragment seems to say, what's keeping it (and therefore d.someView) from getting garbage collected as soon as it goes out of scope? 'setVideoDataSource' is documented to *not* retain the view (in

Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5

2008-05-03 Thread Antonio Nunes
On May 3, 2008, at 6:54 AM, Joel Norvell wrote: If you use PDFKit 10.5 to save and then restore a pdf file, are PDFAnnotationTextWidget stringValues preserved? (These are the text fields that you enter in PDF forms.) They are not preserved. If you are saving data into your own file

Re: Crashes with NSOpenPanel and garbage collection

2008-05-08 Thread Antonio Nunes
On May 9, 2008, at 3:12 AM, Daniel Parnell wrote: I'm having an interesting problem. I'm trying to use NSOpenPanel to select some files (as one usually does), however if I compile with garbage collection on and then try to use the Music, Photos or Movies areas in the open panel I get

Re: Query with PDF Page display in PDFview

2008-05-16 Thread Antonio Nunes
On May 16, 2008, at 7:39 AM, Amrit Majumdar wrote: Consider a multipage Page PDF document. When the user launches the application All the pages of the document will be displayed in two rows. The pages will be resized and row one will display 5 pages,row two will display 5 pages. The user

Re: Storing PDF selection

2008-05-16 Thread Antonio Nunes
On May 16, 2008, at 7:43 AM, Laurent Cerveau wrote: If I have a PDF View , select part of it and get the currentSelection, showing it tells something like Page index = 2, Range = (0, 21] However I do not see where I could get the range of the PDFSelection and later recreate a selection

Re: Storing PDF selection

2008-05-17 Thread Antonio Nunes
On May 17, 2008, at 2:02 PM, Laurent Cerveau wrote: On May 16, 2008, at 9:11 AM, Antonio Nunes wrote: You ask the page for a selection for the range you provide, and assign that to PDFView's current selection: [somePDFView setCurrentSelection:[yourRememberedPage

Re: PDFPage Creation query

2008-05-22 Thread Antonio Nunes
On May 22, 2008, at 10:20 AM, Amrit Majumdar wrote: I was planning to create a new PDFDocument, with my own PDF Page that I generate after subclassing PDFPage Accordingly I subclassed PDFPage and have over-riden [initWithImage] [...] MyPDFPageClass *myPDFPage = [[ MyPDFPageClass alloc

File still in use after closing document window

2008-06-02 Thread Antonio Nunes
Hi, My NSDocument based app loads (imports) PDF files into its documents. After a PDF file has been loaded, and the document window it was loaded into has been closed, the original cannot be deleted when emptying the trash, because the finder thinks it is still in use. It is necessary to

Re: File still in use after closing document window

2008-06-02 Thread Antonio Nunes
On Jun 2, 2008, at 2:06 PM, Hamish Allan wrote: My NSDocument based app loads (imports) PDF files into its documents. What code are you using to load them? The actual loading is done like this: self.masterPDFDocument = [[ANPDFDocument alloc] initWithURL: absoluteURL]; Although I

Re: File still in use after closing document window

2008-06-03 Thread Antonio Nunes
On Jun 3, 2008, at 8:46 AM, Bill Bumgarner wrote: The actual loading is done like this: self.masterPDFDocument = [[ANPDFDocument alloc] initWithURL: absoluteURL]; If your -setMasterPDFDocument: -- synthesized or manually written -- follows traditional reatain/release rules, the above

Re: File still in use after closing document window

2008-06-03 Thread Antonio Nunes
On Jun 3, 2008, at 9:13 AM, Bill Bumgarner wrote: You can use gdb to figure out who is hanging on to the object for longer than expected. Print the address of it immediately after the above line of code. Then, after closing the document and after hitting pause to drop into gdb, try:

Re: File still in use after closing document window

2008-06-03 Thread Antonio Nunes
On Jun 3, 2008, at 5:52 PM, Bill Bumgarner wrote: Why can't you pause the program in Xcode? Because it is running in Instruments? Yes, I could find no way to pause it after Start with Performance Tool- Leaks (or Object Allocations for that matter). But then I realised I should attach the

Re: Garbage collector vs variable lifetime

2008-06-06 Thread Antonio Nunes
On 7 Jun 2008, at 01:42, Bill Bumgarner wrote: The easiest way to do this is to simply to use data once after the for() loop: NSData* data = get it from somewhere; const unsigned char* bytes = [data bytes]; NSUInteger count = [data length]; for (NSUInteger i =

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Antonio Nunes
On 7 Jun 2008, at 06:16, Ken Thomases wrote: On Jun 6, 2008, at 10:48 PM, Antonio Nunes wrote: Why not explicitly turn off collection for the data pointer: NSData* data = get it from somewhere; [[NSGarbageCollector defaultCollector] disableCollectorForPointer:data]; const unsigned char

Re: Garbage collector vs variable lifetime

2008-06-09 Thread Antonio Nunes
On 9 Jun 2008, at 00:53, Chris Kane wrote: On 7 Jun 2008, at 09:07, Antonio Nunes wrote: On 7 Jun 2008, at 06:16, Ken Thomases wrote: The issue is, how can one know when this technique is necessary? By proper documentation. As Bill mentioned earlier, the documentation needs to mention

Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-14 Thread Antonio Nunes
On 14 Jun 2008, at 05:28, Wilhelm Phillips wrote: In order to achieve the desired result I subclassed PDFPage from PDFKit to draw the appropriate numbers and PDFDocument to apply that pageClass to any pages that I add to myPDFDocument. An alternative may be to try to leverage

Re: PDFKit guidance

2008-06-20 Thread Antonio Nunes
On 20 Jun 2008, at 11:07, Torsten Curdt wrote: you can't go wrong by reading the Cocoa Drawing Guide. Surely will read through that. Because frankly speaking I didn't think this was Quartz related. Well, you need to know how to generally draw in Cocoa, and you need to know how to take

Re: PDFKit guidance

2008-06-20 Thread Antonio Nunes
On 20 Jun 2008, at 12:47, Torsten Curdt wrote: The scaling is done when a PDFPage needs to be drawn, so you need to implement it in your subclass's drawWithBox: method. Use an affine transform set up to serve your needs and apply it to the current graphics context within the drawWithBox:

Crash after saving document

2008-07-04 Thread Antonio Nunes
Hi, In my garbage collected app I'm seeing a crash after saving a document to disk (or any of the other export metods that bring up the save panel). The crash doesn't happen always, but still with some frequency (I can usually get it to reproduce between every 10-20 saves/exports). I

Re: controlling system muting ?

2008-07-08 Thread Antonio Nunes
On 8 Jul 2008, at 10:25, Mike Abdullah wrote: Search the archives, someone fairy recently open sourced a nice NSSound category that allows volume control, just to make your life easier. That would be me :-) The thread appears to be hard to find in the archives, so here is a link:

Re: Finding AS related memory leak

2008-07-09 Thread Antonio Nunes
Taking this back to the list, as I think it came off by mistake... On 9 Jul 2008, at 14:56, John C. Daub wrote: It's difficult to say what the problem IS, but I can suggest a few things to look at: on 7/9/08 1:48 AM, Antonio Nunes at [EMAIL PROTECTED] wrote: When the script runs

Re: Finding AS related memory leak

2008-07-09 Thread Antonio Nunes
On 9 Jul 2008, at 15:40, Antonio Nunes wrote: Taking this back to the list, as I think it came off by mistake... Hmmm, directed it back to the wrong list at that. Apologies. António --- And could you keep your heart in wonder

Re: Hillegass, Third Edition, Chapter 18

2008-07-15 Thread Antonio Nunes
On 15 Jul 2008, at 07:44, Jeff Brown wrote: Just an aside - does Hillegass, Third Edition teach you Core Data? The blurb on Amazon says it does but when I looked at the index online it didn't mention Core Data. Yes, it does. Chapter 11: Basic Core Data. António

Re: Hillegass, Third Edition, Chapter 18

2008-07-15 Thread Antonio Nunes
On 15 Jul 2008, at 04:53, Jon Buys wrote: I'm working through the challenge app at the end of Chapter 18 of Cocoa Programming, Third Edition. I've got my app to the point where it can draw ovals, but each time I click in the window it seems like the view redraws itself. I'm sure that

Re: Hillegass, Third Edition, Chapter 18

2008-07-15 Thread Antonio Nunes
On 15 Jul 2008, at 12:25, Jon Buys wrote: Thanks for your help, I'm going through your code now, comparing it to my old code and reading the documentation. NSUnionRect doesn't seem to be much help in the docs though: Returns the smallest rectangle that completely encloses both aRect and

Re: How to get the cursor animation effects - Clouds of smoke when deleting something

2008-07-28 Thread Antonio Nunes
On 28 Jul 2008, at 12:33, Oleg Krupnov wrote: For example, when I drag something outside a view to get rid of it, the cursor shows a vanishing cloud of smoke and plays a special sound. Have a look at NSShowAnimationEffect in the docs. António

Re: exporting PDF ...

2008-08-08 Thread Antonio Nunes
On 8 Aug 2008, at 09:31, Brasseur Valery wrote: I need to export PDF from a Cocoa application... what is the best way to do it : + using Print/Save AS PDF + using the PDF kit, subclassing PDFPage + using other library That depends on how much control you need. If your application can

Re: Non-NSObject object and garbage collection

2008-08-11 Thread Antonio Nunes
On 11 Aug 2008, at 12:56, Oleg Krupnov wrote: Will it cause a memory leak if I treat the Quartz object in the same way as I do to all my NSObject descendants, i.e. no retains and rely only on garbage collection? You either take care of the object's life time manually as you would in a

Re: Non-NSObject object and garbage collection

2008-08-11 Thread Antonio Nunes
On 11 Aug 2008, at 13:14, Antonio Nunes wrote: Will it cause a memory leak if I treat the Quartz object in the same way as I do to all my NSObject descendants, i.e. no retains and rely only on garbage collection? You either take care of the object's life time manually as you would in a non

Expanding outline view item ancestry

2008-08-15 Thread Antonio Nunes
Hi, Although there is a fair number of posts referencing expandItem I couldn't quite find this in the archives, although I had expected it to be a fairly common scenario: I search for an item that belongs to a tree that is shown in an NSOutlineView. When I find the item, I want the

Re: Expanding outline view item ancestry

2008-08-15 Thread Antonio Nunes
On 15 Aug 2008, at 22:37, Antonio Nunes wrote: I search for an item that belongs to a tree that is shown in an NSOutlineView. When I find the item, I want the outline view to show the it (if it is currently collapsed) and select its row. For that I wrote the following code, that should

Re: Expanding outline view item ancestry

2008-08-15 Thread Antonio Nunes
On 15 Aug 2008, at 23:01, Corbin Dunn wrote: See my response email to why that isn't possible. You can log a bug, but I won't change it. Thanks for the explanations Corbin. I'll leave it then. :-) António --- What you have inside you

Re: Calling an object from a C function

2008-08-20 Thread Antonio Nunes
On 20 Aug 2008, at 01:06, Charlie Dickman wrote: Now, how do I define things like 'self' and 'super' to a C program? Put like this the question doesn't make sense. But maybe this is useful: If you have a C function that _conceptually_ is part of an object and that needs to access 'self'

Re: Calling an object from a C function

2008-08-20 Thread Antonio Nunes
On 20 Aug 2008, at 11:16, Ken Thomases wrote: Well, you can try to achieve this result with the Objective-C runtime. The better approach would be to have the C function be a very simple wrapper around an Objective-C method (as you illustrated) and then have that method invoke 'super' if

UI elements in custom view mess up drawing

2008-10-14 Thread Antonio Nunes
Hi, I have a custom view that draws half a frame and a gradient: - (void)drawRect:(NSRect)rect { // This results in darker separator line at left side. [[NSColor colorWithCalibratedWhite:0.18 alpha:1.0] set]; NSRectFill(NSMakeRect(NSMinX(rect), NSMinY(rect), 1,

Re: UI elements in custom view mess up drawing

2008-10-14 Thread Antonio Nunes
On 14 Oct 2008, at 14:43, Benjamin Stiglitz wrote: The rect passed to -[NSView drawRect:] is the dirty rect of the view, not the bounds of the view. The changing subviews are dirtying your view and then you're drawing as if that changed area was your complete frame. Try replacing your use

Re: Leaking CGColor objects

2008-10-26 Thread Antonio Nunes
On 26 Oct 2008, at 14:25, DKJ wrote: 1. Is there such a thing as a CGColor class? I don't see it in the documentation; but CGColor is what Instruments lists as the leaked objects. You are creating CGColor objects to which you receive pointers of type CGColorRef. You are at C level here,

Re: Draw NSBezierPath inside a PDFPage

2009-03-07 Thread Antonio Nunes
On 7 Mar 2009, at 10:51, malcom wrote: is possible to draw NSBezierPath inside a PDFPage? How? Yes it is. How, depends on what you want to do, but you provide no information about that. Is it for onscreen drawing only, or is it to be incorporated into the PDF page saved/printed? Are you

Re: Draw NSBezierPath inside a PDFPage

2009-03-07 Thread Antonio Nunes
On 7 Mar 2009, at 22:17, malcom wrote: In fact I need to make a small editor that allow the user to draw and edit NSBezierPath (like in Sketch example) inside a PDFPage and then incorporate them inside the page (in a second moment). My temp solution is to draw an image with the pdf

Re: How to determine if a PDFPage is image based? (A scanned page)

2009-09-13 Thread Antonio Nunes
On 13 Sep 2009, at 13:01, DairyKnight wrote: Is there a way to determine if a PDFPage contains only a picture? There seems to be plenty of routines for rendering/drawing in Core Graphics, but none for extracting PDF information? You need to parse and analyse the page streams. Look up the

[iPhone] Authentication failing on device after changing registration data

2009-11-11 Thread Antonio Nunes
In the app I'm developing I connect to a server, to request some data. This works fine. An authentication challenge is received and processed, and the connection performs beautifully. If however I then change the username/password, and attempt to connect again, the authentication is refused by

Re: [iPhone] Authentication failing on device after changing registration data

2009-11-12 Thread Antonio Nunes
On 12 Nov 2009, at 08:43, Roland King wrote: are you definitely receiving a challenge the *second* time you run the app? It is possible that the server sends a cookie representing the login which the phone has now cached and is sending along with the request (automatically) which is

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 PDFAnnotation

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

Re: Animating NSSplitPane position

2011-06-16 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 this

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

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 use

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 use

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

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 will be triggered whenever the font panel

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

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 then

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

2011-10-23 Thread Antonio Nunes
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: 2011-10-21

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

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 delegate

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 books

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: 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

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 figured

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.

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

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. However, I have received a very

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

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’ will

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 allow

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

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

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 the literal string is not empty). That is quite

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

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 devli...@sintraworks.com 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-weak pointer. I'm *really

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 not know

Layout constraint related exceptions

2012-05-16 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

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: I

Re: PDFThumbnailView Problem (kind of)

2012-05-23 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

@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 !=

Re: @synchronized crashing with ARC

2012-05-31 Thread Antonio Nunes
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, António Scott On May 31, 2012, at 8:47 AM, Antonio Nunes wrote: I

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

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 we just

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

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 attributes

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 devli...@sintraworks.com 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 your session state as a plist

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

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 does not

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 building on

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 until I

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)pageIndex { if

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

Re: How to sandbox an included framework

2012-08-16 Thread Antonio Nunes
On 16 Aug 2012, at 07:34, Mike Abdullah cocoa...@mikeabdullah.net 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 devli...@sintraworks.com wrote

Re: How to sandbox an included framework

2012-08-16 Thread Antonio Nunes
On 16 Aug 2012, at 07:34, Mike Abdullah cocoa...@mikeabdullah.net wrote: On 15 Aug 2012, at 18:48, Antonio Nunes devli...@sintraworks.com 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

Re: Prevent display of PDF controls in a WebView

2012-09-02 Thread Antonio Nunes
On 2 Sep 2012, at 18:32, Phillip Mills phillip.mil...@acm.org 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

  1   2   >