Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xcoder1987

macrumors newbie
Original poster
Mar 30, 2011
3
0
Hello, I have a string from which using for-loop ,each char has been converted into ascii and then xored with an integer. I converted each output back to its relevant char. I need to print all those output characters all at once on the label field in the iphone GUI.

I not able to get the part where I need to print them all onto the label field. Here is the code. Any help is appreciated. Thanks in advance

Code:
-(IBAction)result {

NSString *str = [[NSString alloc] initWithFormat:@"%@", [sword text]];

for ( NSInteger i=0; i<[str length]; i++ )
{
    unichar c = [str characterAtIndex:i];

    int asciiCode1 = ([kword.text intValue]);

    int z = asciiCode1 ^ c;

     int a = (char)z;
}
label.text = [NSString stringWithFormat:@"  %c", a];
 
Last edited by a moderator:
Posting the same question on different forums at the same time is considered rude, Rahul. I'm sure you think your time is valuable. So does everyone else.
 
I am quiet new to using forums and dint know that the users would be common. I apologize for that.
 
IMO, it's reasonable to make a second post to another forum after a reasonable time with no good response. Like 24 hours.

People take time to write their responses. It's not fair to have people take time to respond if you've already gotten a response in another forum. And if there are multiple responses on one forum those readers on the other forum probably won't see them.

Anyway, you've gotten a response on the other forum.
 
When posting code that doesn't compile, say "It doesn't compile", and provide the exact text of the error message, preferably by copy and pasting it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.