Questions tagged [nsmutablestring]

The NSMutableString class declares the programmatic interface to an object that manages a mutable string — that is, a string whose contents can be edited — that conceptually represents an array of Unicode characters.

To construct and manage an immutable string — or a string that cannot be changed after it has been created — use an object of the NSString class.

The NSMutableString () class adds one primitive method

-replaceCharactersInRange:withString:

to the basic string-handling behavior inherited from NSString . All other methods that modify a string work through this method.

More information : NSMutableString Class reference

306 questions
1
vote
3 answers

How to convert AttributedString to NSMutableString Swift?

I have HTML and was converted to AttributedString. Now, I need to change the generated Attributed string's font but I'm having a hard time retaining the style(Bold, Italic or Regular). I found a solution but the problem is I don't know how to use…
dreiohc
  • 11
  • 1
  • 5
1
vote
1 answer

setString NSMutableString

I am new to programming in XCode, and as a first familiarisation exercise, I would like to make a small Calculator app. So obviously I came upon a few problems: I try to have the user use buttons to type the digits and operators into a string, which…
1
vote
2 answers

iPhone Objective C - How to remove URLs from an NSString

I am looking for an efficient way to replace URLs in an NSString (or NSMutableString) with the replacement word 'link', for example ... @"This is a sample with **http://bitbanter.com** within the string and heres another **http://spikyorange.co.uk**…
RobbiewOnline
  • 1,350
  • 1
  • 16
  • 36
1
vote
3 answers

Crash when invoking stringWithString on NSMutableString object

I have the following code running when the user clicks the "Save" button: - (IBAction) onSaveChangesClick:(id)sender { NSMutableString *newGroups = [[NSMutableString alloc] init]; for (int i = 0; i < [self.isInGroupArr count]; i++) { if…
ofirbt
  • 1,846
  • 7
  • 26
  • 41
1
vote
1 answer

Converting NSMutableString to NSUrl in Objective C

I actually stuck with a problem while parsing xml-file from a dynamic url in Objective-C. The Parser works fine for the whole project, but now I have to set a dynamic URL to parse the needed XML-File. I have two Variables: One for the BaseURL and…
1
vote
2 answers

Objective C, and NSMutableString

Header File: @interface Picker : UITableViewController { NSMutableString *currentRow; } @property (nonatomic, retain) NSMutableString *currentRow; @end Implementation File: #import "Picker.h" @implementation…
Fozz
  • 167
  • 3
  • 16
1
vote
1 answer

Swift 4: Issues passing data from one NSViewController to another

In a macOS app I am attempting to have a sheet popup where the user can input text. Once the user add's text they click save closing the sheet and adding the text to the previous pages NSTextView. I have tried many variations of this but I'm…
1
vote
0 answers

How to remove HTML tags from string - Objective C

How to remove HTML tags from string, So string is as follows: myString = @"
A.Yesuvin
  • 25
  • 6
1
vote
1 answer

objective-c: Extremely Strange and annoying string problem

i've been working on a tableview program and i have a function that processes several data from user preferences, and core-data. the program parses these things and returns a url adress. heres the code: NSUserDefaults *prefs = [NSUserDefaults…
dreampowder
  • 1,644
  • 3
  • 25
  • 41
1
vote
2 answers

Swift 3 NSMutableParagraphStyle : NSLineBreakMode.byWordWrapping keep breaking the words

I have a NSMutableParagraphStyle style that I apply to a NSMutableAttributedString: import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let myString = "Before a telephone call,…
fabien
  • 2,228
  • 2
  • 19
  • 44
1
vote
1 answer

NSMutableString to NString results in "message sent to deallocated instance"

I have data in an NSMutableString, localPName. I want to save the user’s data like so: [[NSUserDefaults standardUserDefaults] setObject:aString forKey:@"thePNameKeyValue"]; The compiler is trying ever so hard to teach me about “message sent to…
d_CFO
  • 85
  • 1
  • 2
  • 8
1
vote
1 answer

NSMutableString is always "out of scope"?

in my .h file i have: #import @interface untitled : UIViewController { NSMutableString * sResults; } @property (nonatomic,retain) NSMutableString * sResults; @end In my .m i have: #import "untitled.h" @implementation…
Mausimo
  • 8,018
  • 12
  • 52
  • 70
1
vote
3 answers

Pointers to the same object Objective-c

I have the following code. When I print out aString it is Goodbye and when i print out bString it is Hellworld. Shouldn't bString be pointing to the same object as aString. I would expect both to print Goodbye. Also when i print out the memory…
James
  • 509
  • 5
  • 14
1
vote
1 answer

A runtime error when using NSMutableString

let address = "http://www.example.com/?cevent=imt%2Fguide%252525252525252F" let address2 = "http://www.example.com/?cevent=imt%2Fguide%2525252525252521" let bodyString=NSMutableString() bodyString.appendFormat("\(address)") when I test in…
san jing
  • 143
  • 1
  • 5
1
vote
2 answers

appendFormat of NSMutableString not append more one item

I used NSMutableString and used appendFormat function, appendFormat set boundary and first image and not append any item more it, I don't know where the error. result in debug:- 2016-03-08 15:52:56.385 PropertyTurkey[474:82387] …
Ahmed Abdallah
  • 2,338
  • 1
  • 19
  • 30