Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Fix plugin for iOS on Cordova 3.0 by disabling ARC and using newer pl…
Browse files Browse the repository at this point in the history
…ugin signature.
  • Loading branch information
agrieve committed Sep 5, 2013
1 parent 7094cc6 commit 14d63e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<header-file src="src/ios/zxing-all-in-one.h" />

<source-file src="src/ios/CDVBarcodeScanner.mm" />
<source-file src="src/ios/CDVBarcodeScanner.mm" compiler-flags="-fno-objc-arc" />
<source-file src="src/ios/zxing-all-in-one.cpp" />

<framework src="libiconv.dylib" />
Expand Down
18 changes: 9 additions & 9 deletions src/ios/CDVBarcodeScanner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ - (BOOL)shouldAutorotate;
//------------------------------------------------------------------------------
@interface CDVBarcodeScanner : CDVPlugin {}
- (NSString*)isScanNotPossible;
- (void)scan:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void)encode:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void)scan:(CDVInvokedUrlCommand*)command;
- (void)encode:(CDVInvokedUrlCommand*)command;
- (void)returnSuccess:(NSString*)scannedText format:(NSString*)format cancelled:(BOOL)cancelled callback:(NSString*)callback;
- (void)returnError:(NSString*)message callback:(NSString*)callback;
@end
Expand Down Expand Up @@ -120,18 +120,18 @@ - (NSString*)isScanNotPossible {
}

//--------------------------------------------------------------------------
- (void)scan:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
- (void)scan:(CDVInvokedUrlCommand*)command {
CDVbcsProcessor* processor;
NSString* callback;
NSString* capabilityError;

callback = [arguments objectAtIndex:0];
callback = command.callbackId;

// We allow the user to define an alternate xib file for loading the overlay.
NSString *overlayXib = nil;
if ( [arguments count] == 2 )
if ( [command.arguments count] >= 1 )
{
overlayXib = [arguments objectAtIndex:1];
overlayXib = [command.arguments objectAtIndex:0];
}

capabilityError = [self isScanNotPossible];
Expand All @@ -152,8 +152,8 @@ - (void)scan:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
}

//--------------------------------------------------------------------------
- (void)encode:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
[self returnError:@"encode function not supported" callback:[arguments objectAtIndex:0]];
- (void)encode:(CDVInvokedUrlCommand*)command {
[self returnError:@"encode function not supported" callback:command.callbackId];
}

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -855,4 +855,4 @@ - (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orien
[super willAnimateRotationToInterfaceOrientation:orientation duration:duration];
}

@end
@end

0 comments on commit 14d63e3

Please sign in to comment.