-
1. 字符串的处理
-
字符串分割以及将数组组合成字符串
NSString *string = @"1234.56";
NSArray *array = [string componentsSeparatedByString:@"."];
NSString *new =[array componentsJoinedByString:@"."];
-
2.多级模态界面
- 开发中有时候需要连续出来多个界面, 但是可能会遇到从最后一个界面直接回到最初的第一个界面, 可以使用下面的方法, 更多关于模态的原理请参考出栈和入栈的原理
- 在最后一个界面 点击返回的方法中添加如下方法
UIViewController *rootVC = self.presentingViewController;
while (rootVC.presentingViewController) {
rootVC = rootVC.presentingViewController;
}
[rootVC dismissViewControllerAnimated:YES completion:nil];
网友评论