Re: Anti-aliasing in Snow Leopard (10.6) PDFView

2010-03-04 Thread Andy Mroczkowski
I just encountered this same problem with PDFView on 10.6. The same
code works fine on 10.5.

Did you ever find a solution? Or is there a bug I can reference?


On Mon, Sep 7, 2009 at 5:50 PM, Duncan McGregor dun...@oneeyedmen.com wrote:
 It used to be that PDFView anti-aliased nicely. Now it doesn't, at
 least not for some files. Text and scans rendered in both the
 PDKKitViewer and PDFLinker2 samples are horrible in 10.6.

 I understand that shouldAntiAlias defaults to true, but even setting
 it explicitly does not seem to help. The display is the same as in
 Preview when PDF smoothing is turned off in Preview preferences.

 Am I missing something obvious?

 Thanks in anticipation

 Duncan McGregor
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/andy%40mrox.net

 This email sent to a...@mrox.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Anti-aliasing in Snow Leopard (10.6) PDFView

2010-03-04 Thread Andy Mroczkowski
Here is a screenshot showing Preview vs PDFLinker2:
http://dl.dropbox.com/u/45634/PDFView-AntiAlias-Issue/PreviewVsPDFView.png

Here is a PDF that exhibits this problem:
http://dl.dropbox.com/u/45634/PDFView-AntiAlias-Issue/PDFView-AntiAlias-Example.pdf

Thank you for your time.
- Andy

On Tue, Sep 8, 2009 at 1:18 PM, John Calhoun calho...@apple.com wrote:
 On Sep 7, 2009, at 3:50 PM, Duncan McGregor wrote:

 It used to be that PDFView anti-aliased nicely. Now it doesn't, at
 least not for some files. Text and scans rendered in both the
 PDKKitViewer and PDFLinker2 samples are horrible in 10.6.

 Can you point to a specific PDF that shows this behavior?

 John Calhoun—___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/andy%40mrox.net

 This email sent to a...@mrox.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Anti-aliasing in Snow Leopard (10.6) PDFView

2010-03-04 Thread Andy Mroczkowski
Thanks Keith, that worked perfectly.

On Thu, Mar 4, 2010 at 12:28 PM, Keith Blount keithblo...@yahoo.com wrote:
 Not sure if this is the same thing, but I recently ran into something similar 
 - a scanned-in newspaper looked terrible and grainy in my app, although 
 Preview handled it smoothly. The solution was to override -drawPage: in a 
 PDFView subclass and set it to use high interpolation if anti-aliasing is 
 turned on, as follows:

 - (void)drawPage:(PDFPage *)pdfPage
 {
    [NSGraphicsContextsaveGraphicsState];

    // Certain PDF files may appear very grainy (low quality) with the default 
 image interpolation. If anti-aliasing is turned on, we therefore
 // make interpolation high.
 // NOTE: I got this fix from Skim.app's source code, so a credit to 
 http://skim-app.sourceforge.net/ goes in the About box.
    [[NSGraphicsContextcurrentContext] 
 setImageInterpolation:([selfshouldAntiAlias] ? NSImageInterpolationHigh: 
 NSImageInterpolationDefault)];

    [super drawPage: pdfPage];
    [NSGraphicsContextrestoreGraphicsState];
 }

 (As you can see from the code comments, the developers are Skim are the ones 
 who came up with the solution, not me.)

 I couldn't see much difference with the PDF you placed in Dropbox, but from 
 the comparison image you posted it does look like the same thing.

 Hope that helps.

 All the best,
 Keith




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [MEET] CocoaHeads Mac Developer Meetings

2008-09-03 Thread Andy Mroczkowski

* Philadelphia, PA - Thursday September 11, 2008 07:00 PM EST

Topic to be announced.

http://cocoaheads.org/us/PhiladelphiaPennsylvania/index.html
http://upcoming.yahoo.com/event/1071293/


--
Andy Mroczkowski:  [EMAIL PROTECTED]
Philly CocoaHeads: http://cocoaheads.org/us/PhiladelphiaPennsylvania/index.html
⎋


On Sep 2, 2008, at 11:35 PM, Stephen Zyszkiewicz wrote:


Greetings,

CocoaHeads is an international Mac programmer's group.  We specialize
in Cocoa, but everything Mac programming related is welcome.

Why Should I Attend?
Meeting other Mac OS X developers in person is both fun and immensely
useful. There's no better way to learn Cocoa or get help with problems
than being around other people who are writing Mac software.

We usually have several Cocoa experts hanging around that are happy to
answer whatever questions they can. Bring your laptop and any code
you're working on.

Everyone is Welcome
Meetings are free and open to the public. Feel free to drop in even if
you've never attended or aren't currently using Cocoa. We usually have
a few new faces, so don't worry about being the odd one out.

Upcoming meetings:
Boston- Thursday September 11, 2008 06:00 PM EST
Boulder- Tuesday September 09, 2008 07:00 PM MDT
Colorado Springs- Thursday September 11, 2008 07:00 PM MST
Des Moines- Thursday September 11, 2008 07:00 PM CST
Golden, CO- Thursday September 20, 2007 07:00 PM MST
Lake Forest, CA- Wednesday September 10, 2008 07:00 PM PST
Kuala Lumpur - Saturday September 20, 2008 03:00 PM HKT
Mexico City- Thursday September 18, 2008 07:00 PM CDT
Minneapolis- Thursday September 11, 2008 06:00 PM CST
New York, NY- Thursday September 11, 2008 06:00 PM EST
Provo- Thursday September 18, 2008 06:00 PM MST
St. Louis-  Saturday September 27, 2008 02:00 PM CST


Please check the web site at http://cocoaheads.org for more
information including last-minute changes. Some chapters may have yet
to post their meeting for this month.


Steve
Silicon Valley CocoaHeads
http://cocoaheads.org
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andy%40mrox.net

This email sent to [EMAIL PROTECTED]





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Adding PDFPage to PDFDocument crashes

2008-09-02 Thread Andy Mroczkowski

Hi Paul,

The structure of your code is very similar to some I wrote, which  
works well for me.


A couple comments:

		PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];

PDFPage *page = [[PDFPage alloc] initWithDocument:tempDoc];
page = [tempDoc pageAtIndex:0];



Here you're creating a PDFPage object and assigning it to the *page  
pointer var.  Then the *page pointer is being immediately re-assigned  
to the first page of tempDoc.  This is why the [page autorelease] was  
blowing up.  The PDFPage object was owned by tempDoc, so it was being  
double released.  Also, the PDFPage initially alloc'd is being  
leaked.  To fix it all, you just want to do:


PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];

PDFPage *page = [tempDoc pageAtIndex:0];

I use the same strategy, which again, Works For Me.

Next:


[pdfpages autorelease]; // coments anyone?
	[outputDoc autorelease];	// is this okay, or should I release  
instead, or ...?
	[view autorelease];		// if(alloced) release, right? isn't that the  
rule?



Well first, pdfpages is no longer declared, but you probably knew that  
=]


The other two autoreleases are correct, though in general I suggest  
using regular release when you can.  The overhead on autorelease isn't  
much but it is non-zero.  Plus it makes over-release bugs a little  
harder to track down sometimes.


Happy Hacking =]

- Andy







Here is the working code, with the nonworking code commented out,  
and some other comments, too:

//==
- (BOOL) renderToPDFFile: (NSArray*) textChunks :(NSString*) file {
	// NSMutableArray *pdfpages = [[NSMutableArray alloc] init]; // not  
using this anymore

NSRect r = NSMakeRect(0, 0, 600, 1);
NSTextView* view = [[NSTextView alloc] initWithFrame:r];
r = [view bounds];
	PDFDocument *outputDoc = [[PDFDocument alloc] initWithData:[view  
dataWithPDFInsideRect:r]];


int i;
for(i = 0; i  [textChunks count]; i++) {
NSTextView* v = [[NSTextView alloc] initWithFrame:r];
NSString *s = [textChunks objectAtIndex:i];
[v insertText:s];
[v sizeToFit];  // this is important for me
r = [v bounds]; // and it seems to work fine

		PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];

PDFPage *page = [[PDFPage alloc] initWithDocument:tempDoc];
page = [tempDoc pageAtIndex:0];

[outputDoc insertPage:page
atIndex:[outputDoc pageCount]]; // this now works

//		[pdfpages addObject:page];	// originally, I was trying to hold  
on to the page objects in an array
//		[page autorelease];		//  WOULD THIS BE CORRECT?  My reading of  
the
		// mmgt stuff tells me yes, since the page is added to an  
array, its refcount is incremmented,
		// WAIT!! now it works without being released or autoreleased.  
HELP!
		// the rule says if I alloc it, I need to release it, so  
what's correct? Am I leaking?

[tempDoc autorelease];
[v autorelease];
}

//  id p;
//	NSEnumerator *e = [pdfpages objectEnumerator];		// here I  
intended to take each pdf page in the array and add it

//  while(p = [e nextObject]) { // to the main 
pdf document
//		[outputDoc insertPage:p 			// this was crashing. seemed to be an  
array out of bounds error
//			atIndex:[outputDoc pageCount]];		// but I could not decipher  
the error message.

//  }   

	[outputDoc removePageAtIndex:0];			// the first page was really a  
dummy

NSData *data = [outputDoc dataRepresentation];
BOOL b = [data writeToFile:file atomically:YES];// this works 
fine

[pdfpages autorelease]; // coments anyone?
	[outputDoc autorelease];	// is this okay, or should I release  
instead, or ...?
	[view autorelease];		// if(alloced) release, right? isn't that the  
rule?

return b;
}

If anyone has a few minutes to comment on this I would appreciate  
it. Some aspects of Cocoa memory management are still odd to me,  
like how to handle___


Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andy%40mrox.net

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com


Re: Adding PDFPage to PDFDocument crashes

2008-09-02 Thread Andy Mroczkowski

Yes you can skip the page variable altogether if you want.

[outputDoc insertPage:[tempDoc pageAtIndex:0] atIndex:[outputDoc  
pageCount]];


Should work fine.

On Sep 2, 2008, at 3:47 PM, Paul Archibald wrote:


Thanks for the comments Andy.

I see what you mean about reassigning that page pointer. As I  
recall, I had trouble fully allocating a page without the pdf  
document. Just using [[PDFPage alloc] init] did not seem to create a  
real pdf page, and trying to do anything with such an object  
failed. I sort of stumbled into this technique. Looking at the code,  
I think I could also just forgo that pointer completely, and go with


PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];
//PDFPage *page = [[PDFPage alloc] initWithDocument:tempDoc];	//  
does this copy the content of the doc to the page?

//page = [tempDoc pageAtIndex:0];
[outputDoc insertPage:[tempDoc pageAtIndex:0] atIndex:[outputDoc  
pageCount]];


I am going to test this idea.  Do you think that it would work? One  
less pointer to manage?



Thanks again for your response.
Paul

On Sep 2, 2008, at 12:28 PM, Andy Mroczkowski wrote:


Hi Paul,

The structure of your code is very similar to some I wrote, which  
works well for me.


A couple comments:

		PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];

PDFPage *page = [[PDFPage alloc] initWithDocument:tempDoc];
page = [tempDoc pageAtIndex:0];



Here you're creating a PDFPage object and assigning it to the *page  
pointer var.  Then the *page pointer is being immediately re- 
assigned to the first page of tempDoc.  This is why the [page  
autorelease] was blowing up.  The PDFPage object was owned by  
tempDoc, so it was being double released.  Also, the PDFPage  
initially alloc'd is being leaked.  To fix it all, you just want to  
do:


PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];

PDFPage *page = [tempDoc pageAtIndex:0];

I use the same strategy, which again, Works For Me.

Next:


[pdfpages autorelease]; // coments anyone?
	[outputDoc autorelease];	// is this okay, or should I release  
instead, or ...?
	[view autorelease];		// if(alloced) release, right? isn't that  
the rule?



Well first, pdfpages is no longer declared, but you probably knew  
that =]


oops, yeah. what I pasted in is not exactly what I am using. I  
missed that.




The other two autoreleases are correct, though in general I suggest  
using regular release when you can.  The overhead on autorelease  
isn't much but it is non-zero.  Plus it makes over-release bugs a  
little harder to track down sometimes.


Point taken.



Happy Hacking =]

- Andy







Here is the working code, with the nonworking code commented out,  
and some other comments, too:

//==
- (BOOL) renderToPDFFile: (NSArray*) textChunks :(NSString*) file {
	// NSMutableArray *pdfpages = [[NSMutableArray alloc] init]; //  
not using this anymore

NSRect r = NSMakeRect(0, 0, 600, 1);
NSTextView* view = [[NSTextView alloc] initWithFrame:r];
r = [view bounds];
	PDFDocument *outputDoc = [[PDFDocument alloc] initWithData:[view  
dataWithPDFInsideRect:r]];


int i;
for(i = 0; i  [textChunks count]; i++) {
NSTextView* v = [[NSTextView alloc] initWithFrame:r];
NSString *s = [textChunks objectAtIndex:i];
[v insertText:s];
[v sizeToFit];  // this is important for me
r = [v bounds]; // and it seems to work fine

		PDFDocument *tempDoc = [[PDFDocument alloc] initWithData:[v  
dataWithPDFInsideRect:r]];

PDFPage *page = [[PDFPage alloc] initWithDocument:tempDoc];
page = [tempDoc pageAtIndex:0];

[outputDoc insertPage:page
atIndex:[outputDoc pageCount]]; // this now works

//		[pdfpages addObject:page];	// originally, I was trying to hold  
on to the page objects in an array
//		[page autorelease];		//  WOULD THIS BE CORRECT?  My reading  
of the
		// mmgt stuff tells me yes, since the page is added to an  
array, its refcount is incremmented,
		// WAIT!! now it works without being released or  
autoreleased. HELP!
		// the rule says if I alloc it, I need to release it, so  
what's correct? Am I leaking?

[tempDoc autorelease];
[v autorelease];
}

//  id p;
//	NSEnumerator *e = [pdfpages objectEnumerator];		// here I  
intended to take each pdf page in the array and add it

//  while(p = [e nextObject]) { // to the main 
pdf document
//		[outputDoc insertPage:p 			// this was crashing. seemed to be  
an array out of bounds error
//			atIndex:[outputDoc pageCount]];		// but I could not decipher

[MEET] Philadelphia Area CocoaHeads: Thur Aug 14th

2008-08-11 Thread Andy Mroczkowski

We are having our very first Philly-area CocoaHeads meeting:

THURSDAY August 14th - 7 PM
@ IndyHall - 32 Strawberry Street in Old City Philadelphia.

http://upcoming.yahoo.com/event/983969/?ps=8

Be there for our maiden voyage!

--
Andy Mroczkowski:  [EMAIL PROTECTED]
Philly CocoaHeads: http://cocoaheads.org/us/PhiladelphiaPennsylvania/index.html
⎋___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: archive only what changed?

2008-07-07 Thread Andy Mroczkowski
Another possible option is CDBStore framework.  I haven't personally  
used it, but it claims to fill the gap between archiving/property  
lists and Core Data.


http://mooseyard.com/projects/CDBStore/

- Andy

On Jul 7, 2008, at 10:25 AM, I. Savant wrote:

\On Mon, Jul 7, 2008 at 10:13 AM, Randy Canegaly  
[EMAIL PROTECTED] wrote:
I have an application whose data model is an NSMutableArray with  
elements
that could be pointers other NSMutableArrays, much like what you  
would
navigate with a NSIndexPath.  I am using NSKeyedArchiver to archive  
the data
model to a file.  Right now I archive the entire top level array  
object (and

therefore all its parts) to the file using archiveRootObject:toFile.
Is it possible to archive only the portion of the data model that  
changed


 There is no direct Cocoa Way to do this, AFAIK. Consider Core Data
(using the SQLite store type).

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andy%40mrox.net

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to disconnect bound views temporarily

2008-06-15 Thread Andy Mroczkowski

Hi Markus,

I'm guessing that your NSArrayController is in the nib itself.  One  
thing you could do is instantiate it programmatically and set it as an  
ivar of some other controller class in the nib (lets call it  
MyWindowController).  Then bind the views to the  
MyWindowController.arrayController.arrangedObjects (or whatever the  
applicable keypath is).


When your view is hidden, you can set  
MyWindowContoller.arrayController to nil and it *should* just work.   
We've used this same pattern in our code, but we're only using the  
arrangeObjects and selectedObjects keypaths of NSArrayController.


Also, I haven't played with NSCollectionView, but it seems odd that it  
has problems if the data changes when its not visible.  It sounds like  
a bug to me...


- Andy



On Jun 15, 2008, at 3:39 AM, Markus Spoettl wrote:


Hi List,

 I have a document window that can show the same data in more than  
one way, very much like Finder, one view mode is an outline, the  
other is a collection. Both are bound to the same data, so they  
reflect changes automatically.


I was wondering if there is some way to tell a controller class  
(like NSArrayController) to temporarily disconnect the bound view  
from the data (other than removing the binding itself). It seems  
that the views are updating the data even if they are not visible,  
consuming memory and processor time. Moreover, NSCollectionView does  
seem to have problems when it's not visible and the data changes (I  
get debug log entries about assertion failures in NSView lockFocus).


Thanks
Markus
--
__
Markus Spoettl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andy.mroczkowski%40gmail.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: When is a document moved or renamed?

2008-06-13 Thread Andy Mroczkowski
I had this same problem.  I was storing some flat-file slave  
documents inside a package-based master document.  This led to  
several problems:


Internally NSDocument stores its path as an FSRef, not just a URL.   
FSRefs allow you to track files as they move around the volume.   
Convenient. But the problem is that when the outside filewrapper of  
the master document is re-written, its internal FSRef changes (though  
the URL will remain the same).  Once the master's FSRef is changed,  
the slave's FSRefs are essentially invalidated.


My solution/workaround was to keep track of the slave document's URL  
myself, and hijack NSDocument's save facility at a high level by  
overriding:


- (void)saveDocumentWithDelegate:(id)delegate didSaveSelector: 
(SEL)didSaveSelector contextInfo:(void *)contextInfo


(note if you do this, you'll have to send the delegate  
didSaveSuccessfully method yourself)


I ran this problem and the gist of my solution by some Apple engineers  
at WWDC and surprisingly they weren't horrified.  They did suggest  
that I should try just re-setting the documents fileURL, which should  
reset the FSRef and help the document find itself again.  I haven't  
had time to try it yet.


Hopefully something in there is useful.

- Andy


On Jun 11, 2008, at 5:01 PM, LAURENS Jérôme wrote:


Hi all,

I have a document based application with 2 kinds of  
documents:masters and slaves

When saving the master document, all its slaves are also saved.
So I override one of the writeToURL method of the master class  
document to send the appropriate writeToURL to its slaves.
My app also does rather complex tasks that need to save the master  
document without user interaction.


In some situations, I cannot send a saveDocument: message to the  
slave document and have a smooth operation:
unexpectedly, a dialog box appears saying that the location of the  
slave document is lost, and that I must save it again.
Then the standard save panel appears, and is already filled with the  
proper name of the slave document.


In the saveDocumentWithDelegate:... description (inside  
NSDocument.h), it is said that


it may present a panel asking the user to make a decision for any  
of the following situations:
 1) The document's file or file package was moved or renamed since  
it was opened or most recently saved.
 2) The document's file or file package was deleted or trashed since  
it was opened or most recently saved.


Since a panel appears, one of the above situation is recognized. But  
in no way, I am willing to move nor rename the file!
The file URL never changes. What puzzles me is that my app perfectly  
knows the URL of the document because it presents the save panel at  
the right location with the right name!


Any hint is welcome,

TIA


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andy.mroczkowski%40gmail.com

This email sent to [EMAIL PROTECTED]


On Jun 11, 2008, at 5:01 PM, LAURENS Jérôme wrote:


Hi all,

I have a document based application with 2 kinds of  
documents:masters and slaves

When saving the master document, all its slaves are also saved.
So I override one of the writeToURL method of the master class  
document to send the appropriate writeToURL to its slaves.
My app also does rather complex tasks that need to save the master  
document without user interaction.


In some situations, I cannot send a saveDocument: message to the  
slave document and have a smooth operation:
unexpectedly, a dialog box appears saying that the location of the  
slave document is lost, and that I must save it again.
Then the standard save panel appears, and is already filled with the  
proper name of the slave document.


In the saveDocumentWithDelegate:... description (inside  
NSDocument.h), it is said that


it may present a panel asking the user to make a decision for any  
of the following situations:
  1) The document's file or file package was moved or renamed since  
it was opened or most recently saved.
  2) The document's file or file package was deleted or trashed  
since it was opened or most recently saved.


Since a panel appears, one of the above situation is recognized. But  
in no way, I am willing to move nor rename the file!
The file URL never changes. What puzzles me is that my app perfectly  
knows the URL of the document because it presents the save panel at  
the right location with the right name!


Any hint is welcome,

TIA


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription: