• 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: mmalcolm crawford <email@hidden>
  • Date: Mon, 13 Mar 2006 15:51:35 -0800


On Mar 13, 2006, at 2:34 PM, Andrew Merenbach wrote:

- (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];
}
[...]
The enumerated entities in the array controller all contain a "contents" string attribute.

- (NSArray *)combinedContentsArray { return [self valueForKeyPath:@"arrangedObjects.contents"]; }


(This gives you an array that contains an NSNull if contents is actually nil. If you want to strip these out, then it would be interesting so see which is faster, performing your own iteration or:


- (NSArray *)combinedContentsArray
{
static NSPredicate *predicate;
if (predicate == nil) {
predicate = [[NSPredicate predicateWithFormat:@"self != nil"] retain];
}
NSArray *contentsArray = [self valueForKeyPath:@"arrangedObjects.contents"];
return, [contentsArray filteredArrayUsingPredicate:predicate]);
}


)

mmalc


_______________________________________________ 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: Mixing Cocoa and Carbon
  • 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: Re: Weird printing and Core Data crash
  • Next by thread: Some kind of view "reference" list
  • Index(es):
    • Date
    • Thread