0

i've created a subclass of an UisegmentControl and added to my project.

#import <UIKit/UIKit.h>

@interface MMcustomsegment : UISegmentedControl

@end

on the storyboard i've chose the right custom class on the identity inspector. But when i run it i've the standard layout of the segmentcontrol...

if i add my custom segment programatically in this way

MMcustomsegment *mySegmentedControl = [[MMcustomsegment alloc]
initWithItems:tipoord];
mySegmentedControl.frame = CGRectMake(20, self.view.frame.size.height - 160, 280, 29);
mySegmentedControl.selectedSegmentIndex = 0;
[mySegmentedControl addTarget:self action:@selector(valueChanged:) forControlEvents: UIControlEventValueChanged];

[self.view addSubview:mySegmentedControl]; 

it works!!

same staff for my custom uistepper

I really don't know how to solve it. thanks

ps sorry for my bad english

Yazid
  • 970
  • 7
  • 14
ilmatthew
  • 3
  • 2
  • Have you hooked up the elements you created in Storyboard with the associated properties in your custom class? – Yazid Jul 21 '13 at 09:49

1 Answers1

0

I dont think there is anything wrong with what you have done in the storyboard. If I understand you correctly you have done like i do in the image below, I have a subclass of UILabel called JSLabel, changing to my custom class like this:

Adding JSLabel

I think you might have some error in the subclass. Maybe you need to fix something there. Can't help you more without more info about your subclass.

Good luck!

Joakim Serholt
  • 403
  • 5
  • 17