Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARC: "Pointer to non-const type 'id' with no explicit ownership"

i am upgrading an iOS 4 project to use it with ARC with the sdk5. So i want to use the automatic refactor method for converting the code to use ARC. Unfortunately it does´t work. I get a lots of errors..

for(id* child in childObjectArray){
    [child removeParentGroupReferences];
}

That gives me the following error output:

Pointer to non-const type 'id' with no explicit ownership

Any help about that? What do i have to change? Thanks for any help..

like image 942
geforce Avatar asked Feb 13 '12 16:02

geforce


2 Answers

Change id* to id. id is already defined as an object pointer.

like image 100
BJ Homer Avatar answered Nov 18 '22 02:11

BJ Homer


id is a type, not an object. That means that id shouldn't be a pointer. Remove the * to fix it.

for(id child in childObjectArray){
    [child removeParentGroupReferences];
}
like image 36
gcamp Avatar answered Nov 18 '22 02:11

gcamp