Top "Nsrange" questions

A structure used to describe a portion of a series—such as characters in a string or objects in an NSArray object.

Convert selectedTextRange UITextRange to NSRange

How can I convert a UITextRange object to an NSRange? I've seen plenty of SO posts about going the other …

ios objective-c nsrange uitextrange
Create an NSRange with a given minimal and maximal value

I have a collection of int64_t values that I need to make an index set out of. I previously …

objective-c nsrange nsindexset
NSMutableAttributedStrings - objectAtIndex:effectiveRange:: Out of bounds

I'm trying to add some fancy text to a label, but I've run into some problems with the NSMutableAttributedString class. …

objective-c macos nsattributedstring nsrange
Cannot convert value of type 'NSRange' (aka '_NSRange') to expected type 'Range<Index>'(aka 'Range<String.CharacterView.Index>')

Getting this error when checking the range for string characters... @objc func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: …

ios swift nsrange
How can I select a string from the beginning until a specified character?

How can I select a string from the beginning until a specified character? For example, in the following a news …

ios objective-c nsstring substring nsrange
Fastest way to get array of NSRange objects for all uppercase letters in an NSString?

I need NSRange objects for the position of each uppercase letter in a given NSString for input into a method …

ios iphone objective-c nsstring nsrange
How do I use NSRange with this NSString?

I have the following NSString: productID = @"com.sortitapps.themes.pink.book"; At the end, "book" can be anything.... "music", "movies", "…

ios objective-c nsrange
How do I uses addAttribute and NSRANGE in swift 3

Hi I'm trying to use addAttribute in Swift3. I want set bold only IDNAME. Here is what I am trying …

swift swift3 nsattributedstring nsrange addattribute
Problem using NSRange: Index out of bounds

I am trying to detect website URL's in my string and then doing some attribution string stuff like bolding it …

iphone cocoa-touch nsstring nsrange
Using Range<Index> with NSRange in the NSAttributedString API

I'm attempting to determine the indexes of occurrences of a given string in a String, then generate an NSRange using …

ios swift range nsattributedstring nsrange