• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Weird printing and Core Data crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Weird printing and Core Data crash (From: Andrew Merenbach <email@hidden>)

  • Prev by Date: Some kind of view "reference" list
  • Next by Date: Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
  • Previous by thread: Weird printing and Core Data crash
  • Next by thread: Re: Weird printing and Core Data crash
  • Index(es):
    • Date
    • Thread