Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Did you declare it with NSMutableArray array;? Did you already assign it to anything else before this? Commented Sep 5, 2010 at 17:47
  • yes i declared it and i just started nsuserdefaults before this Commented Sep 5, 2010 at 17:52
  • 1
    I'm not sure if this is your problem, but the syntax for checking if the array is not nil would be if (array != nil) — no message-sending brackets. However, nil and an empty array are two different values. If you want to check for an empty array, use if ([array count] != 0). Commented Sep 5, 2010 at 20:35