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
1
vote
1 answer
numberOfRowsInSection not overriding Attributes Inspector
In Swift 2, working on a UITableView that will dynamically create cells based on the contents of a dictionary. The dictionary has 38 entries. When I manually set the Table View Section to have 38 rows in the Attributes Inspector, everything works as…

pruette
- 53
- 1
- 7
1
vote
1 answer
Swift: NSRangeException when initializing UITableViewCells
I'm having some minor issues trying to get my UITableView to function correctly. This is what the error looks like:
* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for…
user3943529
1
vote
1 answer
A loop causing NSRangeExceptionindex
I got a simple loop, in which I want to append a variable to an array if it exists. Every variable is checked... Anybody knows why this is crashing?
This is the error I get:
NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0…

Alfro
- 1,524
- 2
- 21
- 37
1
vote
2 answers
Receive NSRangeException error message "objectAtIndex beyond bounds"
In one class called LevelSelectViewController, I have this public property
@property (nonatomic, strong, getter=getLevelNumber) NSNumber *levelNumber;
which stores an int value based on a UIButton* touch selection using the method
-…

Frank
- 107
- 9
1
vote
0 answers
NSRangeException beyond bounds when inserting row into a tableview off screen iOS
I'm having a problem with my Swift/iOS app when it comes to dealing with a UITableView using static cells.
My tableview has a couple of sections in it, which in turn each section has a couple of rows in it. In my code, if you tap on one of the…

user5823259
- 11
- 3
1
vote
1 answer
strange crash in iOS
There is a group of crashes reported by crittercism.
I've never reproduced it but there're about 50 times from different users in 1 weeks.
21
XXApp 0x0000000100129fb0 -[NSString(XXFormat) attributedStringFromHTMLByFont:] (NSString+XXFormat.m:15) was…

canius
- 93
- 5
1
vote
1 answer
Nested UITableView in a UITableView Causes NsRangeException with Index Out of Bound in iOS
I have an iOS 7/8 application. In a view I have a static UITableView with given number of cells - 17 in my case.
One of the cells contains another UITableView with dynamic cells. In the case described they are 20.
Because of the difference in the…

Mihail Velikov
- 566
- 1
- 8
- 14
1
vote
1 answer
Checking user inputted URLs in Objective C/XCode 6 - NSRangeException
G'day,
I'm attempting to check user-inputted URLs in a browser app. The aim is to add the http:// etc scheme if the user doesn't input it, and to assume they're after a Google search if they include any spaces within the text field.
I think I'm just…

northsydneybears
- 31
- 5
1
vote
0 answers
xcode project export error
I have this problem: I sent to a friend my xcode project, he is able to open and run without errors, but at some point the app crashes.
More precisely app manages a sqlite database that stores the scores of the game and just when he tries to enter…

Gio Bact
- 541
- 1
- 7
- 23
1
vote
3 answers
App crashing when table cell expanded
I have a system in place to add a cell to a section when the already existing cell is pressed. The app crashes when I try to expand any section after and including indexpath 3. It generates the following crash report:
Terminating app due to uncaught…

user3126921
- 23
- 3
1
vote
2 answers
Strange NSRangeException beyond bounds error in NSMutablearray
In my app, I'm doing audio analysis.
Every second, I'm calling some methods, like this one :
- (NSNumber *) arrayAverage: (NSMutableArray *)array
{
int countArray = [array count];
if(!countArray)
return nil;
else if (countArray…

jcr
- 303
- 1
- 6
- 16
1
vote
0 answers
Application crash NSRangeException
We have created a Phonegap application for iOS with Xcode4.5 and integrated Bing map using HTML.
we are using cordova-1.9.0
When we run our application in iOS7 then application crashes with below exception.
* Terminating app due to uncaught…

user2834478
- 21
- 2
1
vote
1 answer
-[NSMutableArray removeAllObjects] and -[NSMutableArray addObject:] throw NSRangeException
The first crash was caused by a call to removeAllObjects, and the second, addObject:
2013-08-01 21:54:05.706 Zipper[1754:1803] An uncaught exception was raised
2013-08-01 21:54:05.721 Zipper[1754:1803] *** Terminating app due to uncaught exception…

Josh The Geek
- 1,203
- 12
- 24
1
vote
0 answers
NSRangeException while adding objects to NSMutableArray
I am programming the search bar logic in an iOS application. I have 1 NSArray "results", which has the entities returned from a NSFetchRequest, and an empty NSMutableArray "resultados" where I want to add the objects returned from the first…

mariogarranz
- 73
- 7
1
vote
2 answers
Substring with range crashes
I am having strange problem. The following substring code crashes with
NSString *string4 = @"
end of the story":
[string4 substringWithRange:NSMakeRange(7, [string4 length] - 1)];
I assume the range is within the…
some

RealityOD
- 69
- 2
- 8