wood burning stoves 2.0*
The moose likes iOS and the fly likes Error because of null pointer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "Error because of null pointer" Watch "Error because of null pointer" New topic
Author

Error because of null pointer

Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

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

My Blog SCJP 5 SCWCD 5
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

It was because of improper population of the array elements.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error because of null pointer
 
Similar Threads
array of array help
Applet notinited
How do I convert a list of list into array [] []
Dead Code on return statement
Connect-four