Re: troubles with tableview
Re: troubles with tableview
- Subject: Re: troubles with tableview
- From: Graham Cox <email@hidden>
- Date: Mon, 30 Nov 2009 20:57:52 +1100
On 30/11/2009, at 7:21 PM, Dorimedont Bancescu wrote:
> -why in initWithCoder the array is loaded, has all the elements and when numberOfRowsInTableView message is send the array is empty and has a different memory address?
Probably because you have two distinct objects. Check the address of 'self' in the case of -init and -initWithCoder:
-initWithCoder: is, as its name suggests, an init method, which is invoked on a freshly alloc'ed object. It is not invoked on an existing object to provide it with new content. I think your problem probably lies in the code above this that is causing the -initWithCoder: method to be invoked by dearchiving something. When you do that you get a new object, but the table's datasource is still set to the previous one.
I'm cc'ing this back to the list in case anyone else can put their finger on it, but from what you've posted so far that's my best guess.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden