Hi
It seems that Objective C jumps thru hoops to make seemingly simple tasks extremely difficult.
I simply need to create a sequence of strings, image1.jpg, image2.jpg, etc etc
ie in a loop
var imgString:String='image'+i+'.jpg;
I assume a best practice is to use a NSMutableString with appendString method?
What am I doing wrong??
NSM...
hello everyone. I am trying to display the contents of a rtf file in uiwebview. I do this by taking the contents of rtf into nsmutablestring and loading it into uiwebview.
The problem is along with the content of rtf, the rtf tags and format is also passed in the nsmutablestring. so i the entire content is displayed along with the rtf ...
Using objective-c on the iPhone, what is wrong with this code?
Is it leaking memory? Why?
How would I do this correctly?
NSMutableString *result = [NSMutableString stringWithFormat:@"the value is %d", i];
... then later in my code... I might need to change this to:
result = [NSMutableString stringWithFormat:@"the value is now %d", i...
I have an NSDictionary with NSStrings
Some of the valueForKey:@"Key" have no entry so it's (null)
NSMutableString* addressDictionaryToString = [NSMutableString string]; // use mutable string!
for (NSDictionary* item in address) { // use fast enumeration!
[addressDictionaryToString appendFormat:@"%@, %@, %@, %@",
[...
I am at a loss as hot to properly initiate a NSMutableString, I have tried:
NSMutableString *string = @"some text";
which is the same method one assigns a string to an NSString but have hade no luck. Additionally I have not been able to figure out how to redefine the string contained with the NSMutableString. I would imagine it would ...
Hi all!
I want simply replace all occourrencies of "+" with a blank " " char...
I tried some sample listed here, also used NSSMutableString, but the program crash...
what's the best way to replace a char from another??
thanks
...
Hi everyone, if I create an nsmutablestring and then release it , shouldn't the retain count be 0?
my retain count stays 1.
NSMutableString *text = [[NSMutableString alloc]init];
[text release];
NSLog(@"retain count %d ", [text retainCount]);
Am I missing something ?
thanks.
...
I'm relatively new to Objective C and while I've been trucking right along writing iPhone apps, I think I need some help understanding something.
I'm storing a dynamic list of strings in an NSMutableArray, which is a property of my main class. In my initialization I alloc and init to store 100 items:
stringList = [[NSMutableArray alloc...
I've got a rather large loop that gets a string, does something to it, than goes onto the next one. I was originally releasing it then reallocating it but thought that is a bit of waste of resources but can't figure out how to just clear it out to reuse it.
...
This makes no sense to me. Maybe someone here can explain why this happens.
I've got an NSMutableString that I alloc at the top of my iPhone app, then append to later in the process. It results in a SIGABRT, which doesn't add up to me. Here's the code:
Header File (simplified):
@interface MyAppDelegate : NSObject <UIApplicationDele...
If I have an NSMutableString containing a random string, then how do I remove all characters from it so that it becomes an empty string?
...
HI all! I am using message deleteCharactersInRange from NSMutableString. And there is a problem that this finction deletes range in a wrong way.
Here is a sample of code that works wrong:
-(void) btnClick
{
NSRange deleteRange = NSMakeRange(0, 1);
[valueStr deleteCharactersInRange:deleteRange];
[self ShowNumber];
}
I have a mutable str...