ios - Running Unit Tests which creates UIKit objects causes breakpoint -


when creating uilabel while running unit tests, causes exc_breakpoint (code=exc_i386_bpt, subcode 0x0)

what doing wrong?

- (void)setlabelcount:(nsuinteger)labelcount {     _labelcount = labelcount;     nsmutablearray *labels = [[nsmutablearray alloc] init];     (int idx=0; idx<self.labelcount; idx++) {         uilabel *lbl = [[uilabel alloc] initwithframe:cgrectzero];     // <---         lbl.backgroundcolor = [uicolor clearcolor];         [labels addobject:lbl];         [self.dataview addsubview:lbl];     }     self.labels = labels;      [self updatecontents]; } 

here unit test calls code

- (void)setup {     cell = [[ldpchartcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"chartcell"];     cell.labelcount = 10;    // <--- }  - (void)teardown {     cell = nil; }  - (void)testthatreuseidentifierisset {     stassertequalobjects(cell.reuseidentifier, @"chartcell", @""); } 


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -