iPad large NSArray - initWithObjects vs. ArrayWithObjects

后端 未结 1 1432
刺人心
刺人心 2021-01-07 07:27

can anyone clear this up for me ?
I am building an iPad App that has a TableViewController that is supposed to show something between 1000 and 2000 strings. I have thos

相关标签:
1条回答
  • 2021-01-07 08:04

    Well, there isn't much difference between them: arrayWithObjects returns an auto-released array that you don't need to release yourself (unless you subsequently retain it), and initWithObjects returns an array you must then release to avoid a memory leak. Performance wise there is no difference between them.

    I would suggest if you're getting a bad access error using initWithObjects but not with arrayWithObjects there might be some sort of memory management error in your code. If you post the code itself you'll probably get a more exact response.

    0 讨论(0)
提交回复
热议问题