Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error because of null pointer

 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am getting the EXC_BAD_ACCESS error when I execute this code.


I think that the square object is collected so I am getting this error.
Is there any solution for this?
Thanks in advance.

Himanshu
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see square defined as a property. It looks to me like it isn't there. Maybe you have it in your interface .h file.

Anyway, if you do have it there, I don't see anywhere where square gets initialized/instantiated to actually refer to any object. So to me that means it starts off null in the beginning.

Maybe I am missing something here, but that seems to be the problem.

Mark
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was because of improper population of the array elements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic