Re: Why doesn't this work on my device?
Re: Why doesn't this work on my device?
- Subject: Re: Why doesn't this work on my device?
- From: Shawn Erickson <email@hidden>
- Date: Thu, 26 Feb 2009 17:59:34 -0800
On Thu, Feb 26, 2009 at 4:43 PM, James Cicenia <email@hidden> wrote:
> OK -
>
> Let me bother you one time more.
>
> I have found, the offending code, based upon log files etc.
>
> currentStates = [[NSMutableArray alloc] init];
> self.currentStates = [self statesWithinMiles:currentMiles];
The above is alloc/init a mutable array and directly assigning that
array to the currentStates ivar (I assume it is an instance var). Then
the code appears to get a unrelated mutable array from the
statesWithinMiles: method and assigns that array to the currentStates
ivar using the dot syntax which is synonymous with doing the following
[self setCurrentStates:[self statesWithinMiles:currentMiles]];
This results in the mutable array you alloc/inited becoming
unreferenced while still "owned" by you code... aka it is leaked.
> currentStates is not holding up in the device. It is somehow or somewhere
> getting released.
> I have searched the project and I am not releasing it anywhere. But, come
> the device, it
> loses itself.
Please post how the currentStates property is defined and ANY code
that assigns something to the property using a setter, dot syntax or
directly to the ivar.
-Shawn
_______________________________________________
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