Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 2.87 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //
  2. //  MyCodeTestAppDelegate.m
  3. //  MyCodeTest
  4. //
  5. //  Created by RogerLin on 2011/3/17.
  6. //  Copyright 2011年 Nieo. All rights reserved.
  7. //
  8.  
  9. #import "MyCodeTestAppDelegate.h"
  10. #import <iconv.h>
  11. @implementation MyCodeTestAppDelegate
  12.  
  13.  
  14. @synthesize window=_window;
  15.  
  16. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  17. {
  18.     #define BUFFER_SIZE 260
  19.     char szSrcBuf[BUFFER_SIZE];
  20.  
  21.     char szDstBuf[BUFFER_SIZE];
  22.  
  23.     size_t nSrc  = 0;
  24.  
  25.     size_t nDst  = 0;
  26.     size_t nRet  = 0;
  27.     char *pSrcBuf = szSrcBuf;
  28.     char *pDstBuf = szDstBuf;
  29.         strcpy(pSrcBuf,"人數");
  30.     nSrc=strlen(pSrcBuf);
  31.     iconv_t cd=iconv_open("BIG5","UTF-8");
  32.         if(cd!=-1)
  33. {
  34.     nRet = iconv(cd,&pSrcBuf,&nSrc,&pDstBuf,&nDst);
  35. NSRunLoop
  36. //    iconv(cd,(char**)&pIn,&inLen,(char**)&pOut,&outLen);//測試v1.04
  37.     iconv_close(cd);
  38. }
  39.     uint32_t out=*(uint32_t *)pDstBuf;
  40.     uint32_t outTest=0xc6bc48a4;
  41.     // Override point for customization after application launch.
  42.     [self.window makeKeyAndVisible];
  43.     return YES;
  44. }
  45.  
  46. - (void)applicationWillResignActive:(UIApplication *)application
  47. {
  48.     /*
  49.      Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
  50.      Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
  51.      */
  52. }
  53.  
  54. - (void)applicationDidEnterBackground:(UIApplication *)application
  55. {
  56.     /*
  57.      Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
  58.      If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
  59.      */
  60. }
  61.  
  62. - (void)applicationWillEnterForeground:(UIApplication *)application
  63. {
  64.     /*
  65.      Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
  66.      */
  67. }
  68.  
  69. - (void)applicationDidBecomeActive:(UIApplication *)application
  70. {
  71.     /*
  72.      Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
  73.      */
  74. }
  75.  
  76. - (void)applicationWillTerminate:(UIApplication *)application
  77. {
  78.     /*
  79.      Called when the application is about to terminate.
  80.      Save data if appropriate.
  81.      See also applicationDidEnterBackground:.
  82.      */
  83. }
  84.  
  85. - (void)dealloc
  86. {
  87.     [_window release];
  88.     [super dealloc];
  89. }
  90.  
  91. @end