Reputation: 5116
I am trying to translate one of my Swift apps into Objective C in order to learn that syntax as Swift apparently is not enough these days, unfortunately.
This is my method declaration:
- (void)getWeatherDataFromURL:(NSString *)url params:(NSString *)parameters {
NSString *urlString = [NSString stringWithFormat:@"%@%@", url, parameters];
NSLog(@"GETTING DATA FROM %@", urlString);
}
I have the following variables declared in the ViewController:
NSString *WEATHER_URL = @"http://api.openweathermap.org/data/2.5/weather";
NSString *APP_ID = @"my_secret_api_key";
It seems to be accepted by XCode however the problem arises when I am trying to call the function:
[self getWeatherDataFromURL:WEATHER_URL params:APP_ID];
I get the following error: Editor placeholder in source file
I have searched StackOverflow however all answers came up with Swift and not Obj-C
Apparently CMD + SHIFT + K did the magic. Xcode is buggy and it turns out there was nothing wrong with the code. However, I believe that the answer below will help other programmers having a problem like on the screenshot.
Upvotes: 2
Views: 520
Reputation: 769
It's not due to Swift or Obj-c language. You have placeholder in your code. Check you don't have any gray placeholders like this:
Upvotes: 2