Hi,
I want to use blocks to extract the min price and the max price from
an NSArray of trips. I've found the following way:
float minValue = 0.0;
[someTrips enumerateObjectsUsingBlock:^(id obj, NSUInteger idx,
BOOL *stop) {
if (minValue == 0.0 || [[obj adultFinalPrice] floatValue] <
On Mon, Jul 12, 2010 at 9:43 AM, vincent habchi wrote:
> Buongiorno :)
>
> Le 12 juil. 2010 à 09:34, Giannandrea Castaldi a écrit :
>
>> I want to use blocks to extract the min price and the max price from
>> an NSArray of trips. I've found the following way:
Yes, as already suggested by Preston, key path operators are very expressive.
Thanks for the suggestions.
Jean
On Mon, Jul 12, 2010 at 4:31 PM, Keith Duncan wrote:
>> overkill. You can get less, faster code by using a for/in loop:
>>
>> float minValue = INFINITY;
>> for(id obj in someTrips)
>>
Hi,
I would like to alloc an object and defer the initialization to
another object, is a good practice? The reason is that I can alloc
several types of objects but the init method have the same signature.
Thanks.
Jean
___
Cocoa-dev mailing list (Cocoa-de
Hi,
I'm developing an atom feed reader for iPhone and I'm trying to
execute a NSFetchRequest with a NSPredicate in a test where the result
should be an array with two objects but instead is emtpy.
There are two entities: Feed (Atom feed) and Entry. In the model Entry
has a relationship with one Fee
Hi,
I'm developing an application for iPhone where the persistence is
managed with CoreData. I've introduced a singleton to initialize and
manage the NSManagedObjectContext, this is how I've defined the
singleton:
static Persistence *singletonPersistence = nil;
@implementation Persistence
+ (voi
Hi,
I have a class with a NSMutableArray as readonly property and I need
to execute an action when a new item is added to the array.
I would like:
- to use key-value observing on my NSMutableArray with the collection
accessor pattern
- to preserve the information hiding of my objects and then to ch