views:

62

answers:

2
unichar c;

c = [myString characterAtIndex:0];

unichar catchcar = [c lowercaseString];

error : invalid reciever type unicar.

I know lowercaseString is used to covert String not character. Is there any solution?

+1  A: 

you could do the following:

unichar catchcar = [[myString lowercaseString] characterAtIndex: 0];

If you have a a character only, do the following:

// given unichar c

unichar catchcar = [[[NSString stringWithCharacters:&c length:1] lowercaseString] characterAtIndex: 0];
Max Seelemann
fileName = [[NSBundle mainBundle] pathForResource: catchar ofType: @"txt"]; is throwing an error. I am passing catchar to filename.
@user426795 - Why are you trying to pass a unichar to a method that takes an NSString? Just use an NSString in that case.
Brad Larson
A: 

Did that really hard?

unichar c = [[myString lowercaseString] characterAtIndex:0];

Try this.

Tony