vendredi 30 janvier 2015

Importing .swift file into Objective-C file results in Missing Context For Method Declaration Error

I am refactoring a few Objective-C ViewControllers and am trying to import a new Controller.swift file into a ViewController.m. However when I do that and run I get "Missing Context For Method Declaration" error for every method in the ViewController.m file.


this causes the error:



#import "ViewController.h"
#import "ContactsController.swift"


When I run without the .swift file import everything works fine. Also I have successfully imported this .swift file into other controllers in the above manner.


However when I change the order of the imports as such it works:



#import "ContactsController.swift"
#import "ViewController.h"


I have tried to research this, but to no avail. What are the possible reasons that the import could work in one order and not the other?




Aucun commentaire:

Enregistrer un commentaire