I'm using the CocoaHTTPServer in my project and now i need to response to a simple GET request with a string. So i check the incoming parameter and i have created an NSString object with the string that i want return. But i don't know how return this string. Obviously i can't use "return xmlList" because xcode remember to me that the pointer is incompatible. The server want a result type NSObject. How can i do?
- (NSObject<HTTPResponse> *)httpResponseForMethod:(NSString *)method URI:(NSString *)path{
HTTPLogTrace();
if ([path isEqualToString:@"/getPhotos"]){
NSString *xmlList = [[NSString alloc] init];
MyServerMethods* myServerMethods = [[MyServerMethods alloc] init];
xmlList = [myServerMethods getPhotos];
NSLog(@"RETURN PHOTOS LIST %@", xmlList);
}
return nil;
}
Thanks
Ok, i have resolved my problem in this mode: