Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-25-2010, 05:43 PM   #1 (permalink)
iPhone Developer
 
Join Date: Oct 2010
Location: Netherlands
Posts: 14
RubenG is on a distinguished road
Exclamation URGENT! Need help with strange UIActionsheet layer.

PRESS HERE TO PLAY THE SCREENMOVIE SHOT WITH THE STRANGE LAYER

If you press the link above a screenmovie wil open with the strange behavior of my UIActionSheet.
As you can see it opens when pressed on the Textfield, and it looks good. But there is something strange.
The done button doesn't works and it looks like there are 2 layers. When you press the done button the gray layer gets lighter.
When you press the button again the application kills. I really tried everyting. The code is below, anybody has a solution or a idea?

This is code:
Code:
 
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {

     return 300;

}

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {

     return 1;

}



- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {

     return [arrayColors count];

}



- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {

     return [arrayColors objectAtIndex:row];

}



- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {

     {

          switch (row)

          {

               case 0:

                    [txtType setText:@"Arbeidsrecht"];

                    break;

               case 1:

                    [txtType setText:@"Bestuursrecht"]; 

                    break;

               case 2:

                    [txtType setText:@"Huurrecht" ];

                    break;

               case 3:

                    [txtType setText:@"Ondernemingsrecht" ];

                    break;

               case 4:

                    [txtType setText:@"Onroerend goed/vastgoedrecht" ];

                    break;

               case 5:

                    [txtType setText:@"Personen en familierecht" ];

                    break;

               case 6:

                    [txtType setText:@"Straf en strafprocesrecht" ];

                    break;

               case 7:

                    [txtType setText:@"Verbintenissenrecht" ];

                    break;

               case 8:

                    [txtType setText:@"Vermogensrecht" ];

                    break;

               case 9:

                    [txtType setText:@"Belastingrecht" ];

                    break;

               case 10:

                    [txtType setText:@"Bijzonder overeenkomstenrecht" ];

                    break;

               case 11:

                    [txtType setText:@"Bouwrecht" ];

                    break;

               case 12:

                    [txtType setText:@"Computerrecht" ];

                    break;

               case 13:

                    [txtType setText:@"Consumentenrecht" ];

                    break;

               case 14:

                    [txtType setText:@"Insolventierecht" ];

                    break;

               case 15:

                    [txtType setText:@"Erfrecht" ];

                    break;

               case 16:

                    [txtType setText:@"Overig rechtsgebied" ];

                    break;

          }

     }

     

}



- (void) showPicker {

     pickerViewPopup = [[UIActionSheet alloc] initWithTitle:@"Welk rechtsgebied?"

                                                              delegate:self

                                                   cancelButtonTitle:nil

                                             destructiveButtonTitle:nil

                                                   otherButtonTitles:nil];

     

     // Add the picker

     pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,44,0,0)];

     

     pickerView.delegate = self;

     pickerView.showsSelectionIndicator = YES;    // note this is default to NO

     

     pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];

     pickerToolbar.barStyle = UIBarStyleBlackOpaque;

     [pickerToolbar sizeToFit];

     

     NSMutableArray *barItems = [[NSMutableArray alloc] init];

     

     UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];

     [barItems addObject:flexSpace];

     

     UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(sluiten:)];

     [barItems addObject:doneBtn];

     

     [pickerToolbar setItems:barItems animated:YES];

     

     [pickerViewPopup addSubview:pickerToolbar];

     [pickerViewPopup addSubview:pickerView];

     [pickerViewPopup showInView:self.view];

     [pickerViewPopup setBounds:CGRectMake(0,0,320, 464)];

     

}



- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex

{

}




-(void)sluiten:(id)sender

{

     [pickerViewPopup dismissWithClickedButtonIndex:0 animated:NO];

     [pickerView release];

     [pickerToolbar release];

     [pickerViewPopup release];

     return YES;

}


When you first press DONE button the background gray layer gets lighter and you can control the pickerview.
When you press the button again to dismiss the actionsheet etc. the app kills with this errors:

#0 0x02be7918 in objc_msgSend
#1 0x07628850 in ??
#2 0x002c97f8 in -[UIApplication sendAction:to:from:forEvent:]
#3 0x004d568b in -[UIBarButtonItem(UIInternal) _sendAction:withEvent:]
#4 0x002c97f8 in -[UIApplication sendAction:to:from:forEvent:]
#5 0x00354de0 in -[UIControl sendAction:to:forEvent:]
#6 0x00357262 in -[UIControl(Internal) _sendActionsForEvents:withEvent:]
#7 0x00355e0f in -[UIControl touchesEnded:withEvent:]
#8 0x002ed3d0 in -[UIWindow _sendTouchesForEvent:]
#9 0x002cecb4 in -[UIApplication sendEvent:]
#10 0x002d39bf in _UIApplicationHandleEvent
#11 0x0336a822 in PurpleEventCallback
#12 0x02a6bff4 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FU NCTION__
#13 0x029cc807 in __CFRunLoopDoSource1
#14 0x029c9a93 in __CFRunLoopRun
#15 0x029c9350 in CFRunLoopRunSpecific
#16 0x029c9271 in CFRunLoopRunInMode
RubenG is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 330
14 members and 316 guests
7twenty7, chiataytuday, condor304, Creativ, Desert Diva, Domele, dre, dreamdash3, laureix68, mottdog, palme2elie, Paul Slocum, schmallegory
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,660
Threads: 94,118
Posts: 402,895
Top Poster: BrianSlick (7,990)
Welcome to our newest member, laureix68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:16 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0