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.

NSRange from Swift Range?

Problem: NSAttributedString takes an NSRange while I'm using a Swift String that uses Range let text = "Long paragraph saying something …

ios macos swift nsrange
NSRange to Range<String.Index>

How can I convert NSRange to Range<String.Index> in Swift? I want to use the following UITextFieldDelegate …

nsstring swift ios8 nsrange
How shouldChangeCharactersInRange works in Swift?

I'm using shouldChangeCharactersInRange as a way of using on-the-fly type search. However I'm having a problem, shouldChangeCharactersInRange gets called before …

ios objective-c swift uitextfielddelegate nsrange
Extracting a string with substringWithRange: gives "index out of bounds"

When I try to extract a string from a larger string it gives me a range or index out of …

objective-c cocoa nsstring nsrange
Make part of a UILabel bold in Swift

I have a UILabel I've made programmatically as: var label = UILabel() I've then declared some styling for the label, including …

ios string swift uilabel nsrange
Getting index of a character in NSString with offset & using substring in Objective-C

I have a string! NSString *myString=[NSString stringWithFormat:@"This is my lovely string"]; What I want to do is: Assuming …

objective-c ios nsstring substring nsrange
Shortcut to generate an NSRange for entire length of NSString?

Is there a short way to say "entire string" rather than typing out: NSMakeRange(0, myString.length)] It seems silly that …

ios objective-c nsstring nsrange
How to get NSRange(s) for a substring in NSString?

NSString *str = @" My name is Mike, I live in California and I work in Texas. Weather in California is nice …

ios nsstring uitextview nsattributedstring nsrange
Create UITextRange from NSRange

I need to find the pixel-frame for different ranges in a textview. I'm using the - (CGRect)firstRectForRange:(UITextRange *)range; …

objective-c ios5 uitextview nsrange
How to create a subarray of NSArray using NSRange?

I have an Array with content. as usual it contain 20 objects. I want the same array split into 2 sections in …

ios objective-c nsarray nsrange arrays