Menu
  • HOME
  • TAGS

Localized App crashes with NSRangeException

ios,ipad,uitableview,nslocalizedstring,nsrangeexception

Turns out I needed to implement indentationLevelForRowAtIndexPath and just return 0.

Swift 2.0: NSRangeException, Range or index out of bounds

swift,nsregularexpression,swift2,nsrangeexception

I see that the first argument to stringByReplacingMatchesInString is 'replacement'. Should this be 'self'?

NSRange changes itself inside for loop

ios,objective-c,nsrange,nsexception,nsrangeexception

By popular demand :) The main issue with your code is that you are directly storing an NSRange struct in your dictionary. You can't do this. You must wrap the NSRange in an NSValue to store it in the dictionary. To add the NSRange you can do: NSRange range =...

NSRangeException index 1 beyond bounds [0 .. 0] for non-empty array

objective-c,nsmutablearray,nsrangeexception

Most likely the problem is somewhere else (the index reported in the error is 1 after all). Try to put an exception breakpoint in order to identify the line that is causing the exception ( and possibly save you a lot of time and confusion on any similar issues in...

iOS Core Data NSRangeException

ios,json,core-data,apple,nsrangeexception

Your troublemaker seems to be NSManagedObject* changesGrabbed = [results objectAtIndex:0]; If results is an empty array, calling objectAtIndex:0 will cause a NSRangeException, because there is no object at index 0. You better call [results firstObject], which won't crash with an error if results is empty array. firstObject() just returns nil...

NSRangeException Xcode

ios,core-data,nsrangeexception

The error is pretty self-explanatory; You're trying to access a value in an empty array. Your CoreData request must not be returning any results. Make sure you check for an empty array before trying to access elements in it. If you delete your app from your device/the simulator it deletes...

Create a UIView title of a push view using the index of an array

iphone,uitableview,uiview,titlebar,nsrangeexception

I forgot that the object I was trying to print had a name and date property. (sorry for making that dumb mistake) The following code does exactly what I wanted it to do. NSString *pushTitle = [[self.WorkoutListArray objectAtIndex:indexPath.row] workoutName]; //set the title newView.title = pushTitle; Thanks for the help and...

Mixing static and dynamic UITableViewController content causes NSRangeException

ios,iphone,ipad,uitableview,nsrangeexception

The actual problem is the way how dynamic and static tableViewControllers work. If you create a dynamic UITableViewController, most methods return nil or 0 or another default value. So nothing bad happens if you don't overwrite them in your UITableViewController subclass. If you create a static UITableViewController, most methods "ask"...

NSRangeException while deleting UICollectionView cells

objective-c,uicollectionview,nsrangeexception

I solved my problem with this answer and little bit modified my code. I've got an NSRangeException because I removed my UICollectionView items through the loop. Instead I should better use multiple deleting instantly like this: // Delete the items from the data source. [self deleteItemsFromDataSourceAtIndexPaths:selectedItemsIndexPaths]; // Now delete the...