【发布时间】:2012-01-03 02:46:39
【问题描述】:
我在从 NSMutable 数组中获取整数值时遇到问题。我在屏幕上有几个具有匹配标签属性值的按钮(button1 的标签值为 1 等)。当按下按钮时,我将数字标记值添加到 NSMutable 数组中。稍后,我想遍历对象以查看按下了哪些值来构建查询。但是,我在循环中得到一个 SIGABRT 错误。
//pairNumber is the 'tag' value from a button
-(void) numberSearchArray:(NSInteger)pairNumber;
{
[self.queryPairs addObject:[NSNumber numberWithInt: pairNumber]];
}
//***************************
-(void)buildQuery:(BOOL *)function numberToUse:(NSInteger)number
{
//other code not shown
int pair_values [6];
int compare_total = [queryPairs count];
for (int x = 0; x<=compare_total-1; x++){
pair_values[x] = (NSUInteger)[queryPairs objectAtIndex:x]; //SIGABRT error
//code continued...
}
【问题讨论】:
标签: xcode nsmutablearray integer