Note that there are some explanatory texts on larger screens.

plurals
  1. POCan someone point me to a leak in this code?
    primarykey
    data
    text
    <p>DisplayMap.h</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #import &lt;MapKit/MKAnnotation.h&gt; @interface DisplayMap : NSObject &lt;MKAnnotation&gt; { CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle; } @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *subtitle; @end </code></pre> <p>DisplayMap.m</p> <pre><code>#import "DisplayMap.h" @implementation DisplayMap @synthesize coordinate,title,subtitle; -(void)dealloc{ [title release]; [super dealloc]; } @end </code></pre> <p>I am implementing the above in a map view to show annotations. On the viewdidload, i run through a set of coordinates and display them on the map using the above mentioned annotation class.</p> <pre><code>for(int i=0;i&lt;[xmlParameter count];i++){ region.center.latitude=(double)[[[xmlParameter objectAtIndex:i]objectAtIndex:3] doubleValue]; region.center.longitude =(double) [[[xmlParameter objectAtIndex:i]objectAtIndex:4] doubleValue] ; region.span.longitudeDelta = 0.08f; region.span.latitudeDelta = 0.08f; DisplayMap *ann = [[DisplayMap alloc] init]; ann.title = [[xmlParameter objectAtIndex:i]objectAtIndex:0]; ann.subtitle = [[xmlParameter objectAtIndex:i]objectAtIndex:1]; ann.coordinate = region.center; [mapView addAnnotation:ann]; if(i==zoomtoParameter){ [mapView setRegion:region animated:YES]; //showAnnotation=ann; [mapView selectAnnotation:currentAnnotation animated:YES]; //[mapView selectAnnotation:ann animated:YES]; } [ann release]; } </code></pre> <p>Running with instruments with leaks, says there is a DisplayMap leak for 32Bytes in the viewDidLoad method. I can't figure out how; i am releasing the DisplayMap object right after am done with it.</p> <p>Any suggestions?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    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