Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In the Xcode lldb debugger, what does <parent is NULL> mean?

Tags:

xcode

ios

lldb

I'm always getting EXC_BAD_ACCESS, so I look to see which variable is pointing to NULL and all I see is that one of my variables (sometimes several) has

< parent is NULL >

next to it. The problem is I don't really know what this means and I can't seem to find anything from a google search or anything about it. I'm thinking this means that that is the NULL variable I'm trying to access, but then the message doesn't make much sense. Anybody know a little more on this?

like image 561
LunaCodeGirl Avatar asked Sep 02 '13 00:09

LunaCodeGirl


2 Answers

It simply means the variable is a pointer to an object and the pointer is NULL.

From the LLDB source:

if (addr == LLDB_INVALID_ADDRESS)
{
    m_error.SetErrorString ("parent address is invalid.");
}
else if (addr == 0)
{
    m_error.SetErrorString ("parent is NULL");
}
else
...
like image 95
trojanfoe Avatar answered Oct 11 '22 20:10

trojanfoe


I too had "parent is NULL" when i printed description of my array object

Thanks to trojanfoe's answer, I was able to see that I was returning my array incorrectly. I simply changed:

- (NSMutableArray *)allItems {
   return self.allItems;
}

to:

- (NSMutableArray *)allItems {
   return _allItems;
}

Hope this helps!

like image 24
Joel Balmer Avatar answered Oct 11 '22 19:10

Joel Balmer