Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory leak vs Zombie - iPhone
    primarykey
    data
    text
    <p>My iPhone app is either crashing due to to a zombie, or leaking memory.. I've narrowed it down to 3 lines of code and can reliably get one of the two things to happen by commenting/uncommenting the code. The bugs occur when navigation between a list of results (tableView) and a details page containing a map and a few labels, memory leak happens the first time I navigation from the map back to the list of results, the zombie occurs after maybe 5/6 times navigating to different results and back.</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import &lt;MapKit/MapKit.h&gt; #define METERS_PER_MILE 1609.344 @interface ResDetailsPageVC : UIViewController &lt;MKMapViewDelegate, UIAlertViewDelegate&gt; { UISegmentedControl *mapTypeSwitcher; MKMapView *mapView; UILabel *nameLabel; UIButton *addressLabel; UILabel *telephoneLabel; NSString *address; } @property (nonatomic, retain) IBOutlet UISegmentedControl *mapTypeSwitcher; @property (nonatomic, retain) IBOutlet MKMapView *mapView; @property (nonatomic, retain) IBOutlet UILabel *nameLabel; @property (nonatomic, retain) IBOutlet UIButton *addressLabel; @property (nonatomic, retain) IBOutlet UILabel *telephoneLabel; - (IBAction)segmentedControlIndexChanged; - (IBAction)callButtonClick; - (IBAction)addressClick; - (void) callNumber; @end @synthesize mapView; @synthesize mapTypeSwitcher; @synthesize nameLabel, addressLabel, telephoneLabel; - (void)dealloc { // if these lines are commented out - memory leak // if not - zombie?! /*self.telephoneLabel = nil; self.addressLabel = nil; self.nameLabel = nil;*/ self.mapView = nil; self.mapTypeSwitcher = nil; [super dealloc]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload