I am trying to replace my custom IP address with the existing URL IP address. How can replace the my IP address with the existing IP. Please find the code snippet below
- (IBAction)btnSubmit:(UIButton *)sender {
NSString *ipAdd = [_txtIPAddress text];
NSLog(@"My entered IP Address is %@", ipAdd);
NSLog(@"Current pointing server value is %@", [ConnManager activeEndpoint]);
NSLog([App appDelegate].isConfigured ? @"Yes" : @"No");
NSArray *listItems = [[ConnManager activeEndpoint] componentsSeparatedByString:@"/"];
ConnManager *conn = [[ConnManager alloc] init];
NSMutableString *configuredUrl = nil;
[configuredUrl setString:@""];
for ( NSInteger i =0; i < listItems.count; i++) {
if(i != 2) {
NSMutableString * arrayElement = [(NSMutableString*)listItems objectAtIndex:i];
NSMutableString *str = [NSMutableString stringWithFormat: @"%@/", arrayElement];
[configuredUrl appendString:str];
} else {
NSMutableString *configstr = [NSMutableString stringWithFormat: @"%@", ipAdd];
NSLog(@"ConfigString %@", configstr);
//How to replace the my ip address with the array index[2]
configuredUrl = [configuredUrl stringByAppendingFormat:configstr];
NSLog(@"Configured Url after apppending %@", configuredUrl);
Thanks in advance