FROM : Julio Cesar Silva dos Santos
DATE : Wed Jul 05 14:15:40 2006
If you are deleting all the objects via code, you must delete from
end to beginning otherwise you will receive the 'index out of bounds'
message, because if you check the count of objects before deleting
this number will decrease at every deletion.
Julio Cesar Silva dos Santos
<email_removed>
Blogjective-C
http://www.jcs.santos.nom.br/wp
FetchYourLyrics
http://www.jcs.santos.nom.br/fyl/fyl.html
On 05/07/2006, at 02:49, Chris Suter wrote:
>> I have a table with data in it. When someone clicks the remove
>> button, I get the selection array and remove all the objects in
>> it. If there is an empty selection, I am told index out of bounds,
>> naturally, because there are no items in the array. Can I just
>> leave this error? Or should I make a catch for it?
>
> No, you shouldn't, you have a bug in your code. Exceptions are
> generally for exceptional circumstances like running out of memory,
> not for something that could often happen.
>
> How are you removing all the items? Send some code.
DATE : Wed Jul 05 14:15:40 2006
If you are deleting all the objects via code, you must delete from
end to beginning otherwise you will receive the 'index out of bounds'
message, because if you check the count of objects before deleting
this number will decrease at every deletion.
Julio Cesar Silva dos Santos
<email_removed>
Blogjective-C
http://www.jcs.santos.nom.br/wp
FetchYourLyrics
http://www.jcs.santos.nom.br/fyl/fyl.html
On 05/07/2006, at 02:49, Chris Suter wrote:
>> I have a table with data in it. When someone clicks the remove
>> button, I get the selection array and remove all the objects in
>> it. If there is an empty selection, I am told index out of bounds,
>> naturally, because there are no items in the array. Can I just
>> leave this error? Or should I make a catch for it?
>
> No, you shouldn't, you have a bug in your code. Exceptions are
> generally for exceptional circumstances like running out of memory,
> not for something that could often happen.
>
> How are you removing all the items? Send some code.
| Related mails | Author | Date |
|---|---|---|
| Rex Fernando | Jul 5, 07:32 | |
| Chris Suter | Jul 5, 07:49 | |
| Sherm Pendley | Jul 5, 08:33 | |
| Julio Cesar Silva… | Jul 5, 14:15 | |
| Steve Bird | Jul 5, 15:08 | |
| Daniel Jalkut | Jul 6, 19:22 | |
| Steve Christensen | Jul 6, 22:00 | |
| I. Savant | Jul 7, 14:41 |






Cocoa mail archive

