i got this warning when i try to get a character at index
Initialization makes pointer from integer without cast
here’s the code :
int random(arch4random()%(string.length));
NSString * char =[string charachterAtIndex:random];
i just wanna
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
from NSString
Is the method. It returns a unichar, not an NSString. You are declaring your variable is an NSString pointer but a unichar is stored as an integer behind the scenes.
Your line should be
as a side note you can’t call your variable char as its a reserved keyword in C.