The instance variables you create here are all autoreleased and will
all be invalid after the first event loop (when the autorelease pool
is released)...
When I remove the setAnswers: method call, the addHeaderRow: method
completes with no problem. When the setAnswers: call included, the
entire addHeaderRow: method completes (the setAnswers: works as
expected), then I get the "EXC_BAD_ACCESS" error and the program
crashes.
That said, premature optimisation is also a bad thing:
I can get AROUND this problem by making the array mutable, and using
addObject: calls, but I have read that Mutable Arrays create more
memory overhead and are less effecient.
Should the content be changed or not? If it should, then it's
appropriate to make it mutable. In general, there's no need for this
sort of optimisation unless a profiling tool shows it's warranted...
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden