嗯,我对手机差距很新。一天前,我将它安装在MAC OSX 10.7.1上,Xcode版本为4.2。
'CDVPlugin.h' file not found
。但我可以在 Cordovalib.xcodeproj 在 NativeControls.h
中#import <Cordova/CDVPlugin.h>
#else
#import "CDVPlugin.h"
#endif
所以任何人都可以指出我做错了什么?我是否需要再次添加CDVPlugin.h和相关文件?
答案 0 :(得分:1)
修改文件NativeControls.h
和NativeControls.m
:
修改后的NativeControls.h
:
//
// NativeControls.h
//
//
// Created by Jesse MacFadyen on 10-02-03.
// MIT Licensed
// Originally this code was developed my Michael Nachbaur
// Formerly -> PhoneGap :: UIControls.h
// Created by Michael Nachbaur on 13/04/09.
// Copyright 2009 Decaf Ninja Software. All rights reserved.
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UITabBar.h>
#import <UIKit/UIToolbar.h>
//#ifdef PHONEGAP_FRAMEWORK
#import <Cordova/CDVPlugin.h>
//#else
//#import "CDVPlugin.h"
//#endif
@interface NativeControls : CDVPlugin <UITabBarDelegate, UIActionSheetDelegate> {
UITabBar* tabBar;
NSMutableDictionary* tabBarItems;
UIToolbar* toolBar;
UIBarButtonItem* toolBarTitle;
NSMutableArray* toolBarItems;
CGRect originalWebViewBounds;
}
/* Tab Bar methods
*/
- (void)createTabBar:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)showTabBar:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)hideTabBar:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)showTabBarItems:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)createTabBarItem:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)updateTabBarItem:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)selectTabBarItem:(NSArray*)arguments withDict:(NSDictionary*)options;
/* Tool Bar methods
*/
- (void)createToolBar:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)resetToolBar:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)setToolBarTitle:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)createToolBarItem:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)showToolBar:(NSArray*)arguments withDict:(NSDictionary*)options;
- (void)hideToolBar:(NSArray*)arguments withDict:(NSDictionary*)options;
/* ActionSheet
*/
- (void)createActionSheet:(NSArray*)arguments withDict:(NSDictionary*)options;
@end
文件NativeControls.m
中的修改:在第22行中,将PGPlugin
更改为CDVPlugin
希望这会有所帮助。
答案 1 :(得分:1)
在Cordova 2.1(仅限) 我通过简单地为给定的PushNotification插件注释if / else来解决这个错误
#import <Foundation/Foundation.h>
//#ifdef CORDOVA_FRAMEWORK
#import <Cordova/CDVPlugin.h>
//#else
//#import "CDVPlugin.h"
//#endif
#import <EventKitUI/EventKitUI.h>
#import <EventKit/EventKit.h>