这是重复我相信这里没有答案的问题: https://stackoverflow.com/questions/34499353/could-not-build-module-parse-xcode-6-1-1
我尝试卸载并重新安装sdks,删除并重新插入框架,并将框架和sdk重新安装到一个全新的项目中,并提供错误消息每次我尝试通过添加#import在AppDelegate.m中添加引用它说无法构建模块'Parse'。这是我遵循的步骤:https://parse.com/apps/quickstart#parse_data/mobile/ios/native/existing。
请帮助我了解我哪里出错,任何反馈意见都会受到高度赞赏。
AppDelegate.m
#import "AppDelegate.h"
#import <Parse/Parse.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// [Optional] Power your app with Local Datastore. For more info, go to
// https://parse.com/docs/ios/guide#local-datastore
[Parse enableLocalDatastore];
// Initialize Parse.
[Parse setApplicationId:@"Removed for security purposes"
clientKey:@"Removed for security purposes"];
// [Optional] Track statistics around application opens.
[PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions];
// Register for Push Notitications
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
//Starting the ROXIMITY Engine!
[ROXIMITYEngine startWithLaunchOptions:launchOptions engineOptions:nil applicationId:@"Removed for security purposes" andEngineDelegate:self];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
[ROXIMITYEngine resignActive]; // Place in applicationWillResignActive
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
[ROXIMITYEngine background]; // Place in applicationDidEnterBackground
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
[ROXIMITYEngine foreground]; // Place in applicationWillEnterForeground
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
[ROXIMITYEngine active]; // Place in applicationDidBecomeActive
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
[ROXIMITYEngine terminate]; // Place in applicationWillTerminate
}
//Adding the following methods for remote notification handling
-(void) application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[ROXIMITYEngine didFailToRegisterForRemoteNotifications:error];
}
-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[ROXIMITYEngine didRegisterForRemoteNotifications:deviceToken];
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
currentInstallation.channels = @[@"global"];
[currentInstallation saveInBackground];}
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
[ROXIMITYEngine didReceiveRemoteNotification:application userInfo:userInfo];
[PFPush handlePush:userInfo];
if (application.applicationState == UIApplicationStateInactive) {
[PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo];
}
}
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
[ROXIMITYEngine didReceiveLocalNotification:application notification:(UILocalNotification *)notification];
}
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
[ROXIMITYEngine didReceiveRemoteNotification:application userInfo:userInfo fetchCompletionHandler:completionHandler];
if (application.applicationState == UIApplicationStateInactive) {
[PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo];}
}
@end
AppDelegate.h
#import <UIKit/UIKit.h>
#import "ROXIMITYSDK.h"
@interface AppDelegate: UIResponder <UIApplicationDelegate, ROXIMITYEngineDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
答案 0 :(得分:0)
在尝试手动集成SDK时,我也遇到了这个问题。我通过使用cocoapods处理整合Parse来解决它。