• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [iphone] Release Navigation View Controller Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iphone] Release Navigation View Controller Question


  • Subject: Re: [iphone] Release Navigation View Controller Question
  • From: Philip Vallone <email@hidden>
  • Date: Tue, 19 Jan 2010 15:37:00 -0500

Thanks,

You are correct. I needed to retain it

@property (nonatomic, retain) NSMutableArray *tableList;
@property (nonatomic, retain) NSMutableArray *cfrTitleList;

Then dealloc it:

- (void)dealloc {
	[tableList release];
	[cfrTitleList release];
	[super dealloc];
}

I spent sometime yesterday reading on memory management and sure to have more questions...

Thanks again,

Phil

On Jan 18, 2010, at 5:58 PM, Alexander Spohr wrote:

>
> Am 18.01.2010 um 14:40 schrieb Philip Vallone:
>
>> Hi this is a follow up question on memory management. In my class BrowseViewController, I have a UITableView and 2 NSMutableArrays.
>>
>> @interface BrowseViewController : UIViewController <UIActionSheetDelegate> {
>> 	IBOutlet UITableView *tableView;
>> 	NSMutableArray *tableList;
>> 	NSMutableArray *cfrTitleList;
>> }
>> @property(nonatomic, retain) UITableView *tableView;
>>
>> @end
>>
>> Now the BrowseViewController has a few "child" Navigational controllers. This allows the user to drill down. My question is, in the BrowseViewController.m dealloc method, if I release the two NSMutableArrays, I receive the error “EXC_BAD_ACCESS”.
>
> Then you forgot to retain them when you should.
> Show code where they are assigned if you can’t fix it.
>
>> If I don't release the NSMutableArrays, does this mean the navigationController takes ownership of the NSMutableArrays?
>
> No, it does not even know they exist. How should it?
>
> 	atze
>

_______________________________________________

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

References: 
 >[iphone] Release Navigation View Controller Question (From: Philip Vallone <email@hidden>)
 >Re: [iphone] Release Navigation View Controller Question (From: Tom Davie <email@hidden>)
 >Re: [iphone] Release Navigation View Controller Question (From: Philip Vallone <email@hidden>)
 >Re: [iphone] Release Navigation View Controller Question (From: Philip Vallone <email@hidden>)
 >Re: [iphone] Release Navigation View Controller Question (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: Getting filesize when downloading file with NSURLDownload?
  • Next by Date: Proper Memory Management
  • Previous by thread: Re: [iphone] Release Navigation View Controller Question
  • Next by thread: NSDrawNinePartImage crash, autorelease sent to freed object
  • Index(es):
    • Date
    • Thread