Table Extension 中实现display方法

This posts helps you to understand and create a "display"  method for the table extension.

Lets say, the requirement is to add a method in the standard table, it can be achieved either by creating a table extension.

So in this scenario we had a requirement to add a display method in the standard table "CustTrans".

In Dynamics 365 we wont be able to add the new method or modify the existing method to the standard table or to an extension table.

It ca

### 配置操作系统或应用程序的显示语言 对于操作系统的显示语言修改,通常涉及系统级别的设置调整。然而,当涉及到特定的应用程序如iOS应用内部国际化而不跟随系统语言的情况时,则需特别处理。 在iOS应用程序中实现自定义的语言切换机制而不是依赖于系统设定的方法之一是在项目初始化阶段就指定所需使用的本地化资源文件夹路径。这可以通过重写`NSBundle`类来达成[^1]: ```objc @interface CustomBundle : NSBundle @end @implementation CustomBundle + (instancetype)bundle { static CustomBundle *sharedInstance; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[self alloc] init]; }); return sharedInstance; } - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)extension { NSString *languageCode = @"zh-Hans"; // 这里可以根据需求动态改变 NSString *path = [[NSBundle mainBundle] pathForResource:languageCode ofType:@"lproj"]; NSBundle *languageBundle = [NSBundle bundleWithPath:path]; return [languageBundle pathForResource:name ofType:extension]; } @end ``` 上述代码展示了如何创建一个继承自`NSBundle`的新类,并覆盖其方法以便能够控制加载哪个`.lproj`目录下的字符串表单。通过这种方式可以在启动时强制使用某种语言版本而忽略用户的设备偏好设置。 为了使整个应用程序都能识别这个新的捆绑包实例作为默认源,在AppDelegate.m 文件顶部加入如下宏定义并替换原有的 `[[NSBundle mainBundle]...]` 调用为 `[CustomBundle bundle]...`: ```objective-c #define NSLocalizedString(key, comment) \ [[CustomBundle bundle] localizedStringForKey:key value:@"" table:nil] ``` 这样就可以让应用内的所有文本都按照预设好的规则来进行多国语支持了。值得注意的是,这里仅提供了一个简单的例子用于说明目的;实际开发过程中还需要考虑更多细节以及优化用户体验等问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值