Re: Problems with Universal Build...
Re: Problems with Universal Build...
- Subject: Re: Problems with Universal Build...
- From: Jerry LeVan <email@hidden>
- Date: Mon, 24 Dec 2007 11:31:19 -0500
On Dec 23, 2007, at 9:38 PM, Ricky Sharp wrote:
On Dec 23, 2007, at 8:13 PM, Jerry LeVan wrote:
You are right about the first two questions, checking the console I
find that the
following error appears immediately after the attempt to write the
pdf
2007-12-23 20:12:35.052 ImageBrowser[2490] *** -[NSCFNumber
isLocked]: selector not recognized [self = 0x3efd00]
2007-12-23 20:12:35.053 ImageBrowser[2490] *** -[NSCFNumber
isLocked]: selector not recognized [self = 0x3efd00]
Since it works fine on Intel I am suspecting an error somewhere in
the ppc libraries...
Why would you say that? If you look at what's given in the console,
you'll see that an instance of NSNumber/CFNumber is being sent the
isLocked message. Looking up isLocked in the docs reveals that it's
a message that can be sent to instances of PDFDocument.
Thus, I believe your app is trashing memory since you're working
with the PDF API and somehow what used to be a PDFDocument instance
is now something else.
Run your app with the various memory-debugging stuff (e.g. zombies,
malloc scribble, etc.)
It appears that on the ppc box that when building a pdf doc by adding
pages, the
pages need to be "kept around".
The following snippet seems to have fixed the problem... I replaced
tmpPage
with an array tmpPage and all of the badness seems to have vanished.
Tain't
clear to me why the non-array approach did not cause a problem on the
Intel side...
Jerry
NSImageView * pdfView;
NSData *pdfData;
//PDFDocument * tmpPage;
NSMutableArray * tmpPage = [NSMutableArray array];
int i;
for(i=0;i< cnt;i++) {
theImage =[ [NSImage alloc] initWithContentsOfFile: [fileNameList
objectAtIndex:i]];
pdfView = [[NSImageView alloc]
initWithFrame:NSMakeRect(0,0,
[theImage size].width,
[theImage size].height)];
[pdfView setImage:theImage];
pdfData = [pdfView dataWithPDFInsideRect:[pdfView bounds]];
//tmpPage = [[PDFDocument alloc] initWithData: pdfData];
//[myBook insertPage:[ tmpPage pageAtIndex: 0] atIndex: i];
[tmpPage addObject: [[[PDFDocument alloc] initWithData: pdfData]
autorelease]];
[myBook insertPage:[ [tmpPage objectAtIndex:i] pageAtIndex:0]
atIndex:i];
//if( i==1) [myBook writeToFile:@"/Users/marijo/Desktop/bar.pdf"];
[pdfView release];
//[tmpPage release];
[theImage release];
[filesLeft setIntValue: --fcnt];
[filesLeft displayIfNeeded];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden