SDSegmentedControl icon indicating copy to clipboard operation
SDSegmentedControl copied to clipboard

SDSegmentedControl hard-freezes iOS devices

Open mickeyl opened this issue 11 years ago • 5 comments

SDSegmentedControl manages to hard-freeze iOS (6.x), so that only a forced shutdown makes it work again. I have created a minimal example that puts the blame on a combination of arrowSize = 0.0 and adding segments at runtime. My theory is that one of the UIKit and/or CoreGraphics library functions is called with an excessive parameter (CGFLOAT_MAX anywhere?) that makes the graphics card go havoc. Here is the minimal example. Note that the simulator handles this case without problems, just the devices (tested on multiple phones and pods) hard-freeze.

@implementation ViewController

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

    [_segmentedControl removeAllSegments];
    _segmentedControl.arrowSize = 0.0;

    [self performSelector:@selector(createMoreSegments:) withObject:nil afterDelay:2.0];

}

- (void)createMoreSegments:(id)sender
{
    for ( int i = 0; i < 5; ++i )
    {
        [_segmentedControl insertSegmentWithTitle:[NSString     stringWithFormat:@"Segment %u", i] atIndex:i animated:NO];
    }
}

@end

mickeyl avatar Jan 25 '13 10:01 mickeyl

Found same issue with the example.

mave99a avatar Jan 30 '13 02:01 mave99a

Have you found a solution to the issue?

inPhilly avatar Mar 19 '13 20:03 inPhilly

I have submitted a bug against iOS and Apple has requested me to add some StackShots, which I'm going to provide. No app should be able to do such a fatal operation, so I guess the creator of SDSegmentedControl is waiting for Apple to fix it.

mickeyl avatar Mar 27 '13 14:03 mickeyl

So really this is unusable at this point?

inPhilly avatar Apr 29 '13 05:04 inPhilly

Yes, for this particular combination (arrowSize = 0.0 and adding segments at runtime). I did not manage to get the StackShots yet for Apple, but i'm working on it.

mickeyl avatar Apr 29 '13 09:04 mickeyl