Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is __NSFrozenArrayM in Core Data Objective - C

i'm trying to fetching coredata entity but it gives this __NSFrozenArrayM and i don't get my array of entity. if any one have idea about then please tell me. Thanks In advance

This is console :-

    <__NSFrozenArrayM 0x6000014468e0>(
    <ExpenseInfo: 0x60000270dea0> (entity: ExpenseInfo; id: 0x92d7006a96eb7229 <x-coredata://B5FE3C43-17E6-4BEA-B3F4-E8093CA29D37/ExpenseInfo/p185> ; data: <fault>),
)

This is my code :-

    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:managedObjectContext];
    [request setEntity:entity];

   NSError *error;

    NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy] ;

    return mutableFetchResults;
like image 593
Yogesh Patel Avatar asked Dec 21 '18 07:12

Yogesh Patel


1 Answers

__NSFrozenArrayM an immutable NSArray sharing its storage with an NSMutableArray that it was -copy'd from (will do a real copy if the original array is mutated).

Reference: https://gist.github.com/Catfish-Man/bc4a9987d4d7219043afdf8ee536beb2

like image 53
Mayur Karmur Avatar answered Nov 05 '22 00:11

Mayur Karmur