I am trying to write a method for a new class called "word", which is a subclass of NSString. I want a method that will accept a NSString containing a single character and return the the place within the word of every instance of that string. I have this so far:
@implementation Word
-(NSMutableArray *)placeOfLetter: (NSString *)letterAsked;{
NSUInteger *len=(NSUInteger *)[self length];
int y=0;
char letter=(char)letterAsked;
for (NSUInteger *x=0; x<len; x++) {
if ([self characterAtIndex:*x]==letter){
[matchingLetters insertObject:x atIndex:y];
y++;
}
}
}
@end
however, xcode is telling me that I cannot put x as a the parameter for insertObject, because the "implicit conversion from NSUInteger to id is disallowed. How can I get around this?
forloop.)