objective c warning
I am parsing an XML but having some problem regrading its attribute. I wan to fetch a value and want to convert into int. in my .h file I have declared
int *count;
and set property (nonatomic , readwrite)int *count;
in .m file
self.count = [[attributeDict objectForKey:@"count"] intValue];
but it gives error " warning: initialization makes pointer from integer without a cast "
what is wrong ?
Thanks..
int *count;
:O
it shoud be int count;
Because you have declared your instance variable as a pointer to an int
instead of as an int
. Drop the *
from the instance variable and the property declaration and make sure the property is assign
not retain
.
It should just be:
int count
You don't want to use a pointer.
链接地址: http://www.djcxy.com/p/26984.html上一篇: xcodebuild不会输出警告和错误?
下一篇: 客观的c警告