I want to put two strings together to form the name of the file passed to a UIImage. I think something like this:
will work.
My question is: Is there some way of doing this more simply or without so much juggling; this solution seems very bloated.
I know I can't do this:
But, something like:
would be good.
trick here is @"foo" needs to remain @"foo"
Sorry to be such a n00b; I'm working on it. I did spend the prerequisite time Googling and found my self more confused afterward.
Please help,
-thisma
Code:
NSMutableString *tempName = [NSMutableString stringWithString:@"foo"];
[tempStemName appendString:@"bar.png"];
imageOfStem = [UIImage imageNamed:tempName];
will work.
My question is: Is there some way of doing this more simply or without so much juggling; this solution seems very bloated.
I know I can't do this:
Code:
imageOfStem = [UIImage imageNamed:@"foo" + @"bar.png"];
But, something like:
Code:
imageOfStem = [UIImage imageNamed:[@"foo" returnStringWithStringAppended:@"bar.png"];
would be good.
trick here is @"foo" needs to remain @"foo"
Sorry to be such a n00b; I'm working on it. I did spend the prerequisite time Googling and found my self more confused afterward.
Please help,
-thisma