小编kon*_*ong的帖子

我是否应该在一个对象中为我的(NSString*)attr使用@property(非原子,复制)或@property(非原子,强)?

@interface PaneBean : NSObject

@property(nonatomic,copy) NSString *name;
@property(nonatomic,copy) NSString *type;
@property(nonatomic,assign) NSInteger width;
@end
Run Code Online (Sandbox Code Playgroud)

我有一个如上所示的PaneBean.

我是应该使用@property(nonatomic,copy)还是@property(nonatomic,strong)为了我(NSString *) name?他们之间有什么区别?

为NSInteger编写'assign'是正确的吗?

任何帮助表示赞赏.谢谢!

objective-c ios

17
推荐指数
2
解决办法
9810
查看次数

如何在"设置"中更改"区域格式"时获取通知

我想要做的是在iPad中将区域格式从英语更改为中国时更改时间格式Settings->Gerneral->International->Region Format.

我试过这个:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateCalendar) name: UIApplicationSignificantTimeChangeNotification object:nil];

-(void)updateCalendar{
self.text=[Toolbox formatDate:dateFormatter WithFormateString:@"EEEE MMMM dd"];
}
Run Code Online (Sandbox Code Playgroud)

但它没有用.我UIApplicationSignificantTimeChangeNotification无法收到任何通知.或许不适用于区域格式更改的通知.是否有通知类型可以做到这一点?

任何帮助都会得到感谢.谢谢!

notifications ios

3
推荐指数
1
解决办法
1565
查看次数

标签 统计

ios ×2

notifications ×1

objective-c ×1