0

I am trying to integrate Parse into a Swift app. I downloaded the SDK, set the app id and added the dependencies, but when I try to import Parse, it says 'No such module - Parse'.

GJZ
  • 2,482
  • 3
  • 21
  • 37

3 Answers3

2

Check that the Parse framework has been copied to your project folder to wherever you keep your 3rd party dependencies (e.g. Vendor).

Then, add the path to the Parse framework to the Framework Search Paths (FRAMEWORK_SEARCH_PATHS) for your build target.

It should look something like this:

$(inherited)
$(PROJECT_DIR)/Vendor/Parse

I'd clean up the DerivedData folder and rebuild.

Bojan Dimovski
  • 1,216
  • 11
  • 25
  • Look at the AppDelegate, the code didFinishLunchingWithOptions is simply wrong, cause the method is redefined in it self, it is an blind copy past error i think.. – Bierbarbar Aug 03 '15 at 22:26
  • Oh, nice one :) Though he gets a "No such module" error, which is usually caused by improper linking or setup of frameworks. – Bojan Dimovski Aug 03 '15 at 22:28
  • @BojanDimovski I am new to setting up frameworks. Where do I put the code and what is the Derived Data folder? – GJZ Aug 03 '15 at 22:33
  • The didFinishLaunchingWithFrameworks is set up in the Parse instructions @Pils19 – GJZ Aug 03 '15 at 22:34
  • 1
    No the DidFinishLunchingWithOptionsMethod is generated, when you start a project you copyed a second from parse in it which is not correct you only have to copy the lines which are shown in the into the method. By the way the copied method from parse isn't complete anyway. @BojanDimovski i thought the same before he updated the Post and i saw the code ;) – Bierbarbar Aug 03 '15 at 22:37
  • @GJZ The framework should be copied to a directory under your project root (e.g. `Vendor/Parse/Parse.framework`). The code should go to the `didFinishLaunchingWithOptions` function and as @Pils19 noted make sure you're not duplicating it, since it's already there. – Bojan Dimovski Aug 03 '15 at 22:39
  • @GJZ Derived Data is an infamous directory where Xcode does all the intermediate processes when building, and cleaning it (which is pretty safe) usually solves a lot of compilaiton problems. http://stackoverflow.com/a/24043863/269108 – Bojan Dimovski Aug 03 '15 at 22:40
  • Oh thanks @Pils19 : But this doesnt get rid of the error – GJZ Aug 03 '15 at 22:41
  • @BojanDimovski Should I delete this data? – GJZ Aug 03 '15 at 22:44
  • After you have finished setting up the framework, try deleting the Derived Data for your project. From Xcode 6.3 it's under Projects, not Organizer in the menu. – Bojan Dimovski Aug 03 '15 at 22:47
  • @Pils19 BojanDimovski - I deleted the data and put in the code but there has been no change. What should I do? – GJZ Aug 03 '15 at 22:49
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/85042/discussion-between-bojan-dimovski-and-gjz). – Bojan Dimovski Aug 03 '15 at 22:49
0

I think this link should be solve your Problem: Set up new Parseproject or here ist explained it for a existing project please check this

Edit after i saw the Code. At first please do not post api keys here this are your private api keys.

second i think the code should look like:

func application(application: UIApplication, didFinishLaunchingWithOptions   launchOptions: [NSObject: AnyObject]?) -> Bool {
    Parse.enableLocalDatastore()

    // Initialize Parse.
    Parse.setApplicationId("appID",
        clientKey: "Key")

    // [Optional] Track statistics around application opens.
    PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)

  //end parse


    // Override point for customization after application launch.
    let splitViewController = self.window!.rootViewController as! UISplitViewController
    let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
    navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
    splitViewController.delegate = self

    let masterNavigationController = splitViewController.viewControllers[0] as! UINavigationController
    let controller = masterNavigationController.topViewController as! MasterViewController
    controller.managedObjectContext = self.managedObjectContext
    return true
 }

you have to put in your Key i corrected the method for you

Bierbarbar
  • 1,399
  • 15
  • 35
0

My problem appears to have been in the naming of the application: I included a number.

Once I corrected this, the error disappeared. Perhaps the name prevents the import of certain frameworks.

GJZ
  • 2,482
  • 3
  • 21
  • 37