NSRangeException is raised when you access a range outside its normal bounds. Range exceptions most commonly occur when looping an array starting at index 1 rather than starting at index 0 as intended.
Questions tagged [nsrangeexception]
130 questions
0
votes
0 answers
NSRangeException using sortedArrayUsingComparator
I am sometimes seeing this exception in Crashlytics:
Fatal Exception: NSRangeException
*** -[__NSArrayM getObjects:range:]: range {0, 6294} extends beyond bounds [0 .. 6292]
-[NSMutableArray sortUsingSelector:]
-[NSArray…

ebi
- 4,862
- 6
- 29
- 40
0
votes
0 answers
SKAction group causes NSRangeException
I am working on sprite kit and now I have a group of SKActions where many nodes perform different actions together. It is after every time the app becomes active from inactive state.
Also I have a double tap gesture recognizer to remove the node…

zh_Vincent
- 17
- 4
0
votes
2 answers
NSRangeException while deleting UICollectionView cells
I'm trying to remove cells from UICollectionView in for.. in loop and every time I get NSRangeException. I can't understand why does it happen because firstly I sort my array and then trying to remove. So the problem is that I firstly try to send…

vendettacore
- 1,439
- 1
- 13
- 28
0
votes
0 answers
cancelAuthenticationChallenge fails with NSRangeException after user hits No
I am trying to cancel an NSURLAuthenticationChanllenge if the server certificate cannot be validated (in my case a self-signed), by popping up an UIAlertView with two buttons -- 'No' and 'Yes'
when user hits Yes, I proceed anyway, but when user hits…

veeru
- 31
- 4
0
votes
1 answer
Localized App crashes with NSRangeException
I have an iOS app that has been working quite well in two languages – I know added some stuff, already keeping in mind using NSLocalizedString for localization etc. The english version of the app works fine so far, but the second language version…

Faser
- 1,256
- 1
- 18
- 36
0
votes
6 answers
[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]
i'm a new iOS developer; i have an application with parse and dynamic cell but when i run the app i find that the app is crashed due to the reason on the title my code as the following
- (UIView *)carousel:(iCarousel *)carousel…

Sonic
- 518
- 1
- 7
- 19
0
votes
1 answer
NSRangeException, but where?
I have an app, which users are reporting to crash at random times. All crashes have the same stack
0 CoreFoundation TAGPBIvarClearUInt32 (in SPONTAN) + 11
1 libobjc.A.dylib _mh_execute_header (in SPONTAN) + 15567
2 CoreFoundation …

Hedam
- 2,209
- 27
- 53
0
votes
1 answer
I am unable to show just simple UIActionSheet in my application in IOS8 on real device
When I run this in IOS 8 I get NSRangeException exception
UIActionSheet *uias = [[UIActionSheet alloc] initWithTitle:@"Test"
delegate:self
…

Renetik
- 5,887
- 1
- 47
- 66
0
votes
1 answer
NSRangeException indexSet count or lastIndex must not exceed -numberOfAssets
I have a new Project from an older Member of our Team.
I Don't know where the Problem is...
// Chooses the photo at the last index
[group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:[group numberOfAssets] - 1] options:0…

alexohneander
- 519
- 3
- 7
- 22
0
votes
3 answers
substringWithRange out of bounds--what am I missing?
I'm trying to extract some strings from some code, and I'm coming up against an NSRangeException I don't understand. Here's my code:
NSString *start = @"";
NSString *end = @" ";
NSRange startRange =…

Joel Derfner
- 2,207
- 6
- 33
- 45
0
votes
1 answer
NSRange changes itself inside for loop
I have an NSDictionary of NSRange objects, with keys for their index in the array. I am attempting to use each of these ranges to create substrings of a larger string, and place each of these substrings in the array. I basically have this completed,…

arc4randall
- 3,275
- 3
- 27
- 40
0
votes
1 answer
Objc 2 collectionviews in one view controller with different length arrays
I am creating a page in my app where a segmented control shows two different collectionviews. The data for the CVs comes from an API which contains two different length arrays.
My problem is that the first Collection View has more items in the…

VickyS
- 13
- 1
0
votes
3 answers
iOS Core Data NSRangeException
I have an issue I cant solve. Im creating an iOS application with Core Data framework. Everything was going just fine until I got NSRangeException. This exception I get in function which checks if Application data needs to be updated.
My code is:
-…

Jacob Jones
- 501
- 2
- 6
- 22
0
votes
1 answer
Warning message with detailed subviews?
Does my code look right? I'm trying to load data into my table view and detailed sub view. My table works fine, but the data wont load in my sub view
The warning appears under this line
nextController.dataItem = [data objectAtIndex:indexPath];
Here…

user278342
- 17
- 3
0
votes
2 answers
Accessing database using sections in UICollection
I am developing small application in iOS (I am complete beginner). I have made a menu Core Data entity where I have categoryName and imageNamed saved. I want my UICollectionView in sections. But I am stuck in defining different indexPaths for…

Kamal Panhwar
- 2,345
- 3
- 21
- 37