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 11-20-2011, 01:12 PM   #1 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 28
marto1914 is on a distinguished road
Default iPhone app to iPad iOS5

I'm using iOS5 SDK. I'm trying to port my iphone app to iPad. I've convert the view to be for iPad. The app is running correctly except when i want to use my custom keyboard. The keyboard is showing but when i touch button there is error unrecognized selector sent to instance. I've read a lot of articles but i can't fix the problem and i'm asking for you help.

CustomKeyboardViewController.h
Code:
#import <UIKit/UIKit.h>
#import "ScorerViewController.h"

@interface CustomKeyboardViewController : UIViewController {
    UITextField *textField;
    ScorerViewController *scorerController;
}

@property (nonatomic, retain) UITextField *textField;
@property (nonatomic, retain) ScorerViewController *scoreController;

-(IBAction)number1Pressed:(id) sender;
-(IBAction)number2Pressed:(id) sender;
-(IBAction)number3Pressed:(id) sender;
-(IBAction)number4Pressed:(id) sender;
-(IBAction)number5Pressed:(id) sender;
-(IBAction)number6Pressed:(id) sender;
-(IBAction)number7Pressed:(id) sender;
-(IBAction)number8Pressed:(id) sender;
-(IBAction)number9Pressed:(id) sender;
-(IBAction)number0Pressed:(id) sender;
-(IBAction)deleteButtonPressed:(id) sender;
-(IBAction)plusButtonPressed:(id) sender;

@end
CustomKeyboardViewController.h
Code:
#import "CustomKeyboardViewController.h"

@implementation CustomKeyboardViewController

@synthesize textField;
@synthesize scoreController;

- (void) addNumber:(NSString*) number {
    if([textField.text length] <= 0)
        textField.text = number;
    else if ([textField.text length] < 3)
        textField.text=[textField.text stringByAppendingString:number];
    
}

-(IBAction)number1Pressed:(id)sender {
    NSLog(@"\nNumber1 pressed\n");
    [self addNumber: @"1"];
}

-(IBAction)number2Pressed:(id)sender {
    [self addNumber: @"2"];
}

-(IBAction)number3Pressed:(id)sender {
    [self addNumber: @"3"];
}

-(IBAction)number4Pressed:(id)sender {
    [self addNumber: @"4"];
}

-(IBAction)number5Pressed:(id)sender {
    [self addNumber: @"5"];
}

-(IBAction)number6Pressed:(id)sender {
    [self addNumber: @"6"];
}

-(IBAction)number7Pressed:(id)sender {
    [self addNumber: @"7"];
}

-(IBAction)number8Pressed:(id)sender {
    [self addNumber: @"8"];
}

-(IBAction)number9Pressed:(id)sender {
    [self addNumber: @"9"];
}

-(IBAction)number0Pressed:(id)sender {
    [self addNumber: @"0"];
}

-(IBAction)deleteButtonPressed:(id)sender {
    if ( [textField.text length] > 0 )
        textField.text = [textField.text substringToIndex:[textField.text length] - 1];
}

-(IBAction)plusButtonPressed:(id)sender {
    [scoreController addScore];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
	return YES;
}

@end
function where i add the custom view:
Code:
- (void) putCustomKeyBoardToCell: (ScoreCell *) cell  {
    CustomKeyboardViewController *customKeyboard1 = [[CustomKeyboardViewController alloc] initWithNibName:@"CustomKeyboardViewController" bundle:nil];
    customKeyboard1.scoreController = self;
    customKeyboard1.textField = cell.scoreToAddPlayer1;
    cell.scoreToAddPlayer1.inputView = customKeyboard1.view;
    
    CustomKeyboardViewController *customKeyboard2 = [[CustomKeyboardViewController alloc] initWithNibName:@"CustomKeyboardViewController" bundle:nil];
    customKeyboard2.scoreController = self;
    customKeyboard2.textField = cell.scoreToAddPlayer2;
    cell.scoreToAddPlayer2.inputView = customKeyboard2.view;    
}
ScoreCell- custom cell
scoreToAddPlayer1, scoreToAddPlayer2 - UITextField.
marto1914 is offline   Reply With Quote
Old 11-26-2011, 02:00 PM   #2 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 28
marto1914 is on a distinguished road
Default

bump
marto1914 is offline   Reply With Quote
Old 11-26-2011, 02:07 PM   #3 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

It would help if you posted the crash message. I know you said it crashes with unrecognized selector but it also tells you which selector.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 11-27-2011, 02:06 AM   #4 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 28
marto1914 is on a distinguished road
Default

it crashes with respectively the button. If i touch button1, number1Pressed and so on.
marto1914 is offline   Reply With Quote
Old 11-27-2011, 02:39 AM   #5 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

It says unrecognized selector to CustomKeyboardViewController right?
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 11-27-2011, 06:04 AM   #6 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 28
marto1914 is on a distinguished road
Default

Now it's just "Program received signal EXC_BAD_ACCES"
marto1914 is offline   Reply With Quote
Old 11-27-2011, 01:25 PM   #7 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

What did you change? Crash messages don't change without any cause. Also, can you just either take a picture of the console or copy and paste the crash message? It'd make helping you a lot easier since crash messages give lots of info.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele 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: 387
18 members and 369 guests
7twenty7, Apptronics RBC, baja_yu, chiataytuday, Clouds, dedeys78, dre, Duncan C, e2applets, iekei, ipodphone, jeroenkeij, leostc, matador1978, mbadegree, QuantumDoja, Retouchable, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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