// // main.m // 作业2 // // Created by syrcfwzx on 16/1/9. // Copyright (c) 2016年 syrcfwzx. All rights reserved. // #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSString* str = @"abc123.xyz789"; NSInteger len = [str length]; NSMutableString* reverse = [NSMutableString string]; for(NSInteger i=len-1;i>=0;i--) { unichar c = [str characterAtIndex:i]; NSString* temp = [NSString stringWithCharacters:&c length:1]; [reverse appendString:temp]; } NSLog(@"%@",reverse); } return 0; }