节目收到信号“sigabrt”

时间:2012-01-23 12:07:46

标签: objective-c ios

我在main.m上收到节目接收信号“sigabrt”

- (IBAction)segmentControl:(id)sender {

     NSTimeInterval oneUnit=(60*60*24*3);
     //NSTimeInterval oneUnit1=(60*60*24*60);

     switch (self.ydm.selectedSegmentIndex) {

         case 0:
             for (i=0; i<([forex count]); i++) { //It does not go next step
                 NSTimeInterval x=oneUnit*i/2;
                 i++;
                 id y=[NSNumber numberWithFloat:[[forex objectAtIndex:i] floatValue]]; 
                  [contentArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSDecimalNumber numberWithFloat:x],@"x",y,@"y", nil]];
                  self.dataForPlot=contentArray;
             }
             break;

         default:
             break;
}

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:0)

更新:先试试

更改

case 0:
         for (i=0; i<([forex count]); i++) { //It does not go next step

   case 0:
      if(!forex)
       {
          NSLog(@"Here is my Error");
         for (i=0; i<([forex count]); i++) { //It does not go next step

如果你得到NSLog ..这不是外汇。

更改

for (i=0; i<([forex count]); i++) 

for (int i=0; i<([forex count]); i++)

再试一次......:D

答案 1 :(得分:0)

我想这个问题是因为 forex 。它似乎是自动释放的。确保在您访问它时可用。您应该在创建时保留

在对问题发表评论后进行修改:

只需更改行

即可
forex=[(NSString *)[Global soapResults] componentsSeparatedByString:@","];

是这样的,

forex=[[(NSString *)[Global soapResults] componentsSeparatedByString:@","] retain];