Re: reused tableViewCell UILabel text is deallocated but not nil ??
Re: reused tableViewCell UILabel text is deallocated but not nil ??
- Subject: Re: reused tableViewCell UILabel text is deallocated but not nil ??
- From: nicolas berloquin <email@hidden>
- Date: Thu, 7 Oct 2010 18:47:14 +0200
Of course, hmm why didn't I think of that. I'll check for this.
The thing is that this string object is an nsmanaged coredata object, that I just pass around.
But thanks for the pointer !
Le 7 oct. 2010 à 18:38, glenn andreas <email@hidden> a écrit :
>
> On Oct 7, 2010, at 11:30 AM, nicolas berloquin wrote:
>>>
>>>> I turned on zombies, and I checked with the debugger, and the textLabel's
>>>> _text is the deallocated instance
>>>> (myName.titre is good).
>>>
>>> This may be a red herring as the state of _text should not effect the ability to assign the property value, generally speaking.
>>
>> Unless they compare the strings before they replace them which is what they seem to do.
>>
>> I have changed my code to do a copy o the string before I assign it to the label and it works. What I don't understand is why the API doesn't either retain or copy it !!
>>
>
> It probably does (and so needs to send a release to the old value). What is likely happening is that you've got your memory management screwed up somewhere, and are over-releasing the (what will be the old) string value, which causes the text fields text ivar to point to garbage.
>
>
> Glenn Andreas email@hidden
> The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL
>
_______________________________________________
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