Gah! addObject not working!

Discussion in 'Mac Programming' started by Duke Leto, May 5, 2008.

  1. Duke Leto macrumors regular

    Mar 17, 2008
    I have some code where there is one array that I add objects to. When I do it, it works. Now I have another array, initialized and created in a very similar way, that will run through addObject (i check this with breakpoints), what I am adding is not null, and its length is still 0. It is an NSMutableArray, and it is synthesized, so where did I go wrong?

    BTW, it still does not add the object even when I make it add a string, like this:
    [myArray addObject:mad:"test"];
  2. mongrol macrumors regular

    Jul 16, 2007
    Need code or we can't tell what you're doing wrong.

    Are you sure you're instantiating the array? It's not enough to declare it.
  3. kpua macrumors 6502

    Jul 25, 2006
    OK, so it's synthesized, but is it initialized?
  4. Duke Leto thread starter macrumors regular

    Mar 17, 2008
    I just made a fool of myself... I need to initialize it. ..

    *puts on dunce cap and goes into hall of shame*

Share This Page