我有2种语言的资源文件,我的应用程序已经读取其中一种语言的值.我希望能够在C#中更改我的应用程序的语言(使用其他资源文件),而不是在"设置"中更改整个手机的语言.
这可能吗?如果是这样,怎么样?
打开ASIHTTPRequest的p12证书时,我遇到内存泄漏.这是获取证书的代码:
- (SecIdentityRef)getClientCertificate {
SecIdentityRef identityApp = nil;
NSString *thePath = [[NSBundle mainBundle] pathForResource:@"myCert" ofType:@"p12"];
NSData *PKCS12Data = [[NSData alloc] initWithContentsOfFile:thePath];
CFDataRef inPKCS12Data = (__bridge CFDataRef)PKCS12Data;
CFStringRef password = CFSTR("myPassword");
const void *keys[] = { kSecImportExportPassphrase };
const void *values[] = { password };
CFDictionaryRef options = CFDictionaryCreate(NULL, keys, values, 1, NULL, NULL);
CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);
OSStatus securityError = SecPKCS12Import(inPKCS12Data, options, &items);
CFRelease(options);
CFRelease(password);
if (securityError == errSecSuccess) {
NSLog(@"Success opening p12 certificate. Items: %ld", CFArrayGetCount(items)); …Run Code Online (Sandbox Code Playgroud)