Quote:
Originally Posted by brush51
Hey dany88,
i have found the mistake in my code.
Code:
- (void) imagePickerController: (UIImagePickerController*) reader
didFinishPickingMediaWithInfo: (NSDictionary*) info
{
// ADD: get the decode results
id<NSFastEnumeration> results =
[info objectForKey: ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for(symbol in results)
break;
TableDetailViewController *tc = [[TableDetailViewController alloc] initWithNibName:@"TableDetailViewController" bundle:nil];
tc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:tc animated:YES];
[tc release];
[reader dismissModalViewControllerAnimated: YES];
}
Can you see it?
It is not possible to set more then one view as animated:YES, right?
so the right way to switch the view is this:
Code:
- (void) imagePickerController: (UIImagePickerController*) reader
didFinishPickingMediaWithInfo: (NSDictionary*) info
{
// ADD: get the decode results
id<NSFastEnumeration> results =
[info objectForKey: ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for(symbol in results)
break;
[reader dismissModalViewControllerAnimated: NO];
TableDetailViewController *tc = [[TableDetailViewController alloc] initWithNibName:@"TableDetailViewController" bundle:nil];
tc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:tc animated:YES];
[tc release];
}
Thanks for your help, and i find it my way : )))
I hope this thread can help others which do the same mistake,
brush51
|
Thank you "tons" for the anwser of this thread, brush51!!!!
I was developing an app using ZBar SDK than meet up with this problem, too. Because of your hard work, I finally figured out where's the problem why mine is STOCKED ;D
Here I still have another problem, which is I need to open different ViewControllers. How should I coding to make it to check TextView's String
to make it open ViewControllers?
Here's my code:
- (void) imagePickerController: (UIImagePickerController*) reader didFinishPickingMediaWithInfo: (NSDictionary*) info
{
// ADD: get the decode results
id<NSFastEnumeration> results = [info objectForKey: ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for(symbol in results)
// EXAMPLE: just grab the first barcode
break;
resultText.text = symbol.data;
resultImage.image = [info objectForKey: UIImagePickerControllerOriginalImage];
[reader dismissModalViewControllerAnimated: NO];
-----------------------Problem from here
switch() <-------------??
{
case 0:
NSLog(@"http://www.xxx01.com");
Company1VC *company1VC = [[Company1VC alloc] initWithNibName:@"Company1VC" bundle:nil];
company1VC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:company1VC animated:YES];
[company1VC release];
break;
case 1:
NSLog(@"http://www.xxx02.com");
Company2VC *company2VC = [[Company2VC alloc] initWithNibName:@"Company2VC" bundle:nil];
company2VC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:company2VC animated:YES];
[company2VC release];
break;
}
}
-------------------> End with Question. Thanks