AD Progress
AD Progress

Reputation: 5116

Objective C Editor Placeholder in source file when calling the method

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

Answers (1)

Anton Novoselov
Anton Novoselov

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: enter image description here

Upvotes: 2

Related Questions