mirror of
https://github.com/zxing/zxing.git
synced 2025-01-13 20:27:34 -08:00
[iphone] ScanTest was not displaying results on my device
git-svn-id: https://zxing.googlecode.com/svn/trunk@1386 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
d7b26bc831
commit
c125dea97a
|
@ -12,8 +12,10 @@
|
||||||
@interface RootViewController : UIViewController <ZXingDelegate> {
|
@interface RootViewController : UIViewController <ZXingDelegate> {
|
||||||
IBOutlet UITextView *resultsView;
|
IBOutlet UITextView *resultsView;
|
||||||
ZXingWidgetController *scanController;
|
ZXingWidgetController *scanController;
|
||||||
|
NSString *resultsToDisplay;
|
||||||
}
|
}
|
||||||
@property (nonatomic, assign) IBOutlet UITextView *resultsView;
|
@property (nonatomic, retain) IBOutlet UITextView *resultsView;
|
||||||
|
@property (nonatomic, retain) NSString *resultsToDisplay;
|
||||||
|
|
||||||
- (IBAction)scanPressed:(id)sender;
|
- (IBAction)scanPressed:(id)sender;
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
@implementation RootViewController
|
@implementation RootViewController
|
||||||
@synthesize resultsView;
|
@synthesize resultsView;
|
||||||
|
@synthesize resultsToDisplay;
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark View lifecycle
|
#pragma mark View lifecycle
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self setTitle:@"ZXing"];
|
[self setTitle:@"ZXing"];
|
||||||
scanController = [ZXingWidgetController alloc];
|
scanController = [ZXingWidgetController alloc];
|
||||||
[scanController setOneDMode:false];
|
[scanController setOneDMode:NO];
|
||||||
[scanController setShowCancel:true];
|
[scanController setShowCancel:YES];
|
||||||
scanController = [scanController initWithDelegate:self];
|
scanController = [scanController initWithDelegate:self];
|
||||||
NSBundle *mainBundle = [NSBundle mainBundle];
|
NSBundle *mainBundle = [NSBundle mainBundle];
|
||||||
[scanController setSoundToPlay:[[NSURL fileURLWithPath:[mainBundle pathForResource:@"beep-beep" ofType:@"aiff"] isDirectory:NO] retain]];
|
[scanController setSoundToPlay:[[NSURL fileURLWithPath:[mainBundle pathForResource:@"beep-beep" ofType:@"aiff"] isDirectory:NO] retain]];
|
||||||
|
@ -63,8 +63,18 @@
|
||||||
#pragma mark Memory management
|
#pragma mark Memory management
|
||||||
|
|
||||||
- (void)scanResult:(NSString *)result {
|
- (void)scanResult:(NSString *)result {
|
||||||
[resultsView setText:result];
|
//[self.resultsView setText:result];
|
||||||
[self dismissModalViewControllerAnimated:true];
|
[self dismissModalViewControllerAnimated:NO];
|
||||||
|
self.resultsToDisplay = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
|
if (resultsToDisplay)
|
||||||
|
{
|
||||||
|
[resultsView setText:resultsToDisplay];
|
||||||
|
[resultsView setNeedsDisplay];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cancelled {
|
- (void)cancelled {
|
||||||
|
@ -88,7 +98,9 @@
|
||||||
|
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[scanController dealloc];
|
[resultsView release];
|
||||||
|
[scanController release];
|
||||||
|
[resultsToDisplay release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue