Re: Weird printing and Core Data crash
Re: Weird printing and Core Data crash
- Subject: Re: Weird printing and Core Data crash
- From: Shaun Wexler <email@hidden>
- Date: Mon, 13 Mar 2006 14:51:49 -0800
On Mar 13, 2006, at 2:34 PM, Andrew Merenbach wrote:
Hi, all. I have a program that constructs a summary, in a text
view, of the contents of two table views--then prints the generated
text view. I keep getting crashes, however, when the print dialog
comes up. It appears that to be something within one of my
methods, which is implemented in a custom NSArrayController
subclass (but I was getting a crash even when it was an independent
method):
/* begin code -- we want an array of strings, which will be joined
elsewhere, from a table view */
- (NSArray *)combinedContentsArray {
NSMutableArray *rowStrings = [[NSMutableArray allocWithZone:[self
zone]] init];
NSEnumerator *e = [[self arrangedObjects] objectEnumerator];
id proxyObj;
while (proxyObj = [e nextObject])
[rowStrings addObject:[proxyObj valueForKey:@"contents"]];
return [rowStrings autorelease];
}
- (NSArray *)combinedContentsArray
{
NSArray *array = [self arrangedObjects];
int index, count = [array count];
NSMutableArray *rowStrings = [NSMutableArray
arrayWithCapacity:count];
for (index = 0; index < count; index++) {
id value, object = [array objectAtIndex:index];
if ((value = [object valueForKey:@"contents"])) {
[rowStrings addObject:object];
}
}
return rowStrings; // [[rowStrings copy] autorelease];
}
--
Shaun Wexler
MacFOH
http://www.macfoh.com
"Things should be described as simply as possible, but no simpler." -
Albert Einstein
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden