iPad Crashing in PresentModalViewController

Discussion created by fsabri on Mar 26, 2013
Latest reply on Mar 27, 2013 by fsabri
Hi ,

i'm building an application that is loading the map in different view from the main view ..

in the first view i'm getting the service url and checking for user name and password .. once the user click "login" i will load
the map using the following :

MapViewController *MapView = [self.storyboard instantiateViewControllerWithIdentifier:@"MapView"];
[self presentModalViewController:MapView animated:YES];
[MapView release];

in the MapViewController i'm loading the Following Graphics Layers in "viewdidload" :

- 2 AGSDynamicMapServiceLayer ..
- 2 AGSFeatureLayer ..
- 5 AGSGraphicsLayer ( i'm adding the Graphicslayer to the map only when i need it , otherwise i'm removing it from the map .. i'm only initializing it on the viewdidload ) ..

in the mapviewcontroller there is a button for logut .. if the user click it , it will dismiss the mapview and show the main view again for the user to login like this :

 [self dismissModalViewControllerAnimated:YES];

in the forth time that the user login or logout the application is crashing and i'm getting "Received memory warning" ..

if i remove all the Graphics Layers and Feature Layer and keep only the mapServiceLayer it's working ..

can someone help me please .. ??