jjzjj

bounding

全部标签

ios - 我有一个问题 "index 3 beyond bounds [0 .. 2]'“

#import"MasterTableViewController.h"@interfaceMasterTableViewController()@end@implementationMasterTableViewController-(void)viewDidLoad{[superviewDidLoad];self.navigationItem.rightBarButtonItem=self.editButtonItem;[self.tableViewsetDelegate:self];[self.tableViewsetDataSource:self];}-(void)viewWi

ios - 为 UIView 的 bounds 属性设置动画

根据可用的Apple文档hereUIView的bounds属性可以设置动画。为了以编程方式旋转我的其中一个View(在本例中是从纵向到横向),我实现了以下代码:floatw=controlsView.bounds.size.width;floath=controlsView.bounds.size.height;CGAffineTransformT=CGAffineTransformMakeRotation(M_PI/2);UIViewContentModeoldContentMode=controlsView.contentMode;controlsView.contentMode=

ios - [UIScreen mainScreen].bounds.size iOS 7 和 iOS 8 的区别

iOS8中的UIScreen现在是面向界面的(Is[UIScreenmainScreen].bounds.sizebecomingorientation-dependentiniOS8?)。我的应用仅在横向模式下运行——因此在iOS7和iOS8中,bounds.size.width和bounds.size.height的值将被交换。为了支持iOS7和iOS8,这是否意味着在我的代码中,我需要检测iOS的版本(或者例如将两个维度中较大的分配给我的“宽度”变量,将较短的分配给“高度'变量)?我应该补充一点,我正在以编程方式创建View。 最佳答案

ios - [__NSArrayM objectAtIndex :]: index 9223372036854775807 beyond bounds [0 . 。 13]'

我在我的xcode项目中实现了一个SQLite数据库。我想将数据库中的所有名称查看到TableView中,但出现错误NSRangeException',reason:'***-[__NSArrayMobjectAtIndex:]:index9223372036854775807beyondbounds[0..13]'@interfaceDisplayViewController()@property(nonatomic,strong)DBManager*dbManager;@property(nonatomic,strong)NSArray*arrPeopleInfo;@end@imp

ios - 错误 : Generic parameter 'R.Generator.Element' cannot be bound to non-@objc protocol type 'AnyObject'

我正在查询HealthKit并将其保存到CoreData。我在一个单独的类中获取数据。在TableViewController中,我将数据附加到数组:ifNSUserDefaults.standardUserDefaults().boolForKey("weightSwitch")==true{xAxisDatesArray.append(cdFetchWeight.queryCoreDataDate())yAxisValuesArray.append(cdFetchWeight.queryCoreDataData())并将其传递给tableView.dequeueReusableCe

iOS 错误 : [__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .。 0]

在我的应用程序中,我尝试从url加载内容,将它们存储在可变数组中并在TableView中显示它们。但我无法让它工作,因为每次我运行该应用程序时都会出现此错误:***Terminatingappduetouncaughtexception'NSRangeException',reason:'***-[__NSArrayIobjectAtIndex:]:index1beyondbounds[0..0]'***Firstthrowcallstack:(0x34dd088f0x36d9e2590x34d2823d0x316e562f0x315f09a90x313c0c5d0x313c1b950

objective-c - 插入对象 : atIndex: - index 3 beyond bounds for empty array

我根据字典键创建一个数组:factsBuiltArray=[NSMutableArrayarrayWithCapacity:6];if([statusDictcount]==10){for(NSString*keyin[statusDictallKeys]){if([keyisEqualToString:@"currenciesAndConversions"]){[factsBuiltArrayinsertObject:keyatIndex:0];}elseif([keyisEqualToString:@"languageAndTranslations"]){[factsBuiltAr

ios - 崩溃 : *** -[__NSArrayM objectAtIndex:]: index 4294967295 beyond bounds [0 .。 9]

我在这个荒谬的索引处得到一个数组越界错误,根据我的研究,这表明可能有一些代码调用了一些负面的东西,比如[arrayobjectAtIndex:-1]问题是这不是我的代码,我无法在任何地方找到它。我到处都设置断点无济于事。我认为它可能在UITableViewDelegate方法中,但不能确定。无论如何都可以访问日志中所有int变量的值。我无法对它们进行NSLog,因为我不知道崩溃发生在哪里。谢谢! 最佳答案 尝试添加异常断点以查看是否捕获它:1)点击断点标签2)点击标签页左下方的“+”按钮3)选择“添加异常断点”4)(可选)将Exce

iphone - -[__NSArrayM objectAtIndex :]: index 4294967295 beyond bounds for empty array with arc4random

编辑:我将arc4random()替换为arc4random_uniform()进行修复我正在使用试飞来监控坠机事故。一直在修复错误,但是我遇到了这个错误,我不确定为什么索引这么大。-[__NSArrayMobjectAtIndex:]:index4294967295beyondboundsforemptyarray很可能这就是bug所在for(NSUIntegeri=0;i导致此处崩溃//FrogNameCaptionNSString*tempCaption=[defaultFrogImageCaptionobjectAtIndex:[defaultFrogImageCaptionc

ios - 是否 drawRect : automatically check whether something is within the bounds of the CGRect passed to it?

我想知道是否需要检查某些内容是否在传递给drawRect:的CGRect范围内,或者drawRect:是否会自动为我处理。例如,假设我在屏幕上有10个UIBezierPaths。每条曲线都在一个名为curves的NSMutableArray中。每次调用drawRect:时,它都会遍历此数组并绘制它在其中找到的曲线。如果使用移动一条曲线,我发现它包含CGRect和调用[selfsetNeedsDisplayInRect:containingRect]。在我的drawRect:实现中,我是否需要亲自检查每个UIBezierPaths是否在传递给drawRect:CGRect内(使用CGRe