AGSCredential* cred = [[AGSCredential alloc] initWithUser:@"mydomain\myusername" password:@"mypassword"]; //pass the credential to layer or task AGSDynamicMapServiceLayer *thelayer = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:[NSURL URLWithString:@"https://myServer.com/ArcGIS/rest/services/DynamicLayerName/MapServer"] credential:cred ]; [self.myMapView addMapLayer:thelayer withName:@"Layer Name"];
Solved! Go to Solution.