Nina
Nina

Reputation: 1679

Phonegap plugin for version 2.0

Well, I am pretty new to phone gap. A day back, I got it installed on MAC OSX 10.7.1 with Xcode version 4.2.

In NativeControls.h

#import <Cordova/CDVPlugin.h>
#else
#import "CDVPlugin.h"
#endif

So can anyone please point out what I am doing wrong? Should I need to add CDVPlugin.h and related files again?

Upvotes: 1

Views: 1493

Answers (2)

Isotope
Isotope

Reputation: 11

In Cordova 2.1 (only) I got around this error by simply commenting out if/else for a given PushNotification plugin

#import <Foundation/Foundation.h>
//#ifdef CORDOVA_FRAMEWORK
#import <Cordova/CDVPlugin.h>
//#else
//#import "CDVPlugin.h"
//#endif
#import <EventKitUI/EventKitUI.h>
#import <EventKit/EventKit.h>

Upvotes: 1

Littm
Littm

Reputation: 4947

The compilation worked after modifying both the files NativeControls.h and NativeControls.m:

Modified 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

Modifications in the file NativeControls.m: in line 22, change PGPlugin to CDVPlugin

Hope this will help.

Upvotes: 1

Related Questions