-2
可能であれば、実行時にコードでアプリ名を に変更することが可能です。 私はこのコード `現時点でアプリ名を変更
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *myPathDocs = [documentsDirectory stringByAppendingPathComponent:@"SelectedImages.plist"];
if ([[NSFileManager defaultManager] fileExistsAtPath:myPathDocs])
{
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager copyItemAtPath:resourcePath toPath:myPathDocs error:NULL];
NSDictionary *dic = [[NSDictionary alloc]initWithContentsOfFile:myPathDocs];
//dic = [[NSBundle mainBundle] infoDictionary];
NSMutableArray *arr =[dic objectForKey:@"CFBundleIconFiles"];
NSLog(@"Number of items %d",[arr count]);
NSLog(@"object %@",[arr objectAtIndex:0]);
[arr replaceObjectAtIndex:0 withObject:@"Icon.png"];
NSLog(@"object %@",[arr objectAtIndex:0]);
[arr writeToFile:myPathDocs atomically:YES] ;
[NSBundle bundleWithPath:myPathDocs];
//[[NSBundle mainBundle]setValuesForKeysWithDictionary:dic];
[arr release];
}
正しいですが、アプリケーションバンドルは読み取り専用です。したがって、それらを編集することはできません – rckoenes