I have a clear history button which clears the data in plist. Now, loading is fine; I load it to an array.
Can I just use:
self.dataClear = NULL;
and save back the array to plist to clear it?
So that I can use
if([self.dataClear count] == 0)//if plist is empty
to check?
You’d probably be better off using a
NSMutableArrayand callingremoveAllObjectson that instead of NULLing it out; otherwise, there won’t be any object there to respond to yourcountmessage, since there’s a conceptual difference between “empty array” and “no array at all”.