Questions tagged [nscharacterset]

An NSCharacterSet object represents a set of Unicode-compliant characters. NSString and NSScanner objects use NSCharacterSet objects to group characters together for searching operations, so that they can find any of a particular set of characters during a search. The cluster’s two public classes, NSCharacterSet and NSMutableCharacterSet, declare the programmatic interface for static and dynamic character sets, respectively.

102 questions
0
votes
1 answer

Convert large mixed numerical and text numbers into numbers in Swift or Objective-C

NSFormatter's spellout method lets you convert a word into a number. NSString's stringByReplacingOccurrencesOfString lets you convert strings such as thousand into 1000. And you can pick integers out of strings using NSCharacterSet. However, I am…
user1904273
  • 4,562
  • 11
  • 45
  • 96
0
votes
1 answer

Converting a CharacterSet to a String or to an array or Set of characters

Fondation has CharacterSet struct (briged to NSCharacterSet) for managing sets of characters, for example when working with Formatter instances. Surprisingly, CharacterSet is not a Set, although the functionality and purpose is totally the same.…
Paul B
  • 3,989
  • 33
  • 46
0
votes
1 answer

Implicit conversion of 'NSStringEncoding' (aka 'unsigned long') to 'NSCharacterSet * _Nonnull' is disallowed with ARC

on following code i'm get the error message: Implicit conversion of 'NSStringEncoding' (aka 'unsigned long') to 'NSCharacterSet * _Nonnull' is disallowed with ARC Where i'm making wrong? NSURL *candidatesURL = [NSURL URLWithString:[str_url …
0
votes
1 answer

Avoid crash from double period during restrained CharacterSet

I have a GPA calculator project I'm close to perfecting. I need to prevent the user from inputting a non-float number despite ".0123456789" being the only allowed characters. For example, if a user inputs 2.3. for whatever reason, my program crashes…
Jon Gi
  • 39
  • 1
  • 8
0
votes
1 answer

Value of tuple Void (aka ()) has no member "isSuperset"

I created a union between two character sets to be able to use a period with the decimalDigits character set. func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { …
Jon Gi
  • 39
  • 1
  • 8
0
votes
1 answer

Creating own character set causes crash

I'm using this piece of code to limit user input regarding the keyboard. func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let allowedCharacters =…
Jon Gi
  • 39
  • 1
  • 8
0
votes
1 answer

UITextFieldDelegate's shouldChangeCharactersIn method - why cannot combine conditional statements checking both # of decimal separators and letters

Why does my replacementTextHasLetter constant not prevent me from pasting in a letter into my textfield with the below conditional? func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String)…
tophst
  • 3
  • 3
0
votes
3 answers

'NSCharacterSet' may not respond to '-count'

I got a warning message in NSCharacterSet *myCharSet3 = [NSCharacterSet characterSetWithCharactersInString:query3]; int chr_count3; chr_count3=[myCharSet3 count]; How to fix that warning ?
saturngod
  • 24,649
  • 17
  • 62
  • 87
0
votes
0 answers

Using an Oracle database and using utl_file to output Welsh characters

Can some one help here? Our database character set is NLS_CHARACTERSET CEL8ISO8859P14. I trying to output using utl_file.put_line at street name as follows B4366 O DAFARN GORS BACH I GYLCHFAN GROESLON TŶ MAWR That is what is held on the…
0
votes
1 answer

Uncaught NSException while checking CharacterSet.isSuperset

I'm trying to verify if the input of an iOS text box is numeric only. In this block, I'm getting an error in XCode 8.0 beta 2. What could I do? func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString…
mynetx
  • 878
  • 7
  • 25
0
votes
1 answer

How to use NSLineSeparatorCharacter and NSParagraphSeparatorCharacter?

I wonder how I can use the constants NSLineSeparatorCharacter and NSParagraphSeparatorCharacter as a parameter to a function instead of hard coding \n. - (id)initWithSeparator:(id)separator { m_separator = separator; } What would be the correct…
JJD
  • 50,076
  • 60
  • 203
  • 339
0
votes
3 answers

What happens when rangeOfCharacterFromSet is called?

What this following code mean, I know this is to avoid typing characters other than numbers in a TextField. But what is actually happening behind this function rangeOfCharacterFromSet . What it will return. if ([string…
Ganesh
  • 1,820
  • 2
  • 20
  • 40
0
votes
1 answer

NSURL crashing when apostrophe in string

I am posting to a NSURL using the new NSCharacterSet to allow spaces and different characters which would otherwise cause the app to crash upon posting. I have come across an issue, whenever I have an apostrophe(') in the text I am posting it causes…
Curtis Boylan
  • 827
  • 1
  • 7
  • 23
0
votes
1 answer

String encoding for all iPhone standard keyboard characters

I am trying to encode a string (to send through HTTP post request) to accept all characters that can be typed on an iPhone. The following works for any characters I try on a typical english desktop keyboard let userPassword = "password1" let…
Tamarisk
  • 929
  • 2
  • 11
  • 27
0
votes
1 answer

unicode general category z* in whitespaceAndNewlineCharacterSet

in nscharacterset class there is whitespaceAndNewlineCharacterSet method which returns few unicodes, i was wondering what is z*,i searched online but couldn't find any explanations. can anyone tell what does unicode category z* mean exactly??? …
n devaraj
  • 134
  • 9