iOS8下的开发变化

来源:互联网 发布:合肥办公软件培训学校 编辑:程序博客网 时间:2024/05/17 21:41
iOS8即将推出,苹果已经提供了iOS8 developer demo以及Xcode6 demo。在此分享下目前为止iOS8的对应要点。 

 

------------------------------------------- 
IOS8 Tabbar变蓝的情况, 已经自己摸索出来了 
 
       if (IOS7以上) { 
            self.tabBarItem = [[UITabBarItem alloc] initWithTitle:self.title image:[UIImage imageNamed:默认图片] selectedImage:[UIImage imageNamed:选择后图片]]; 
            self.tabBarItem.selectedImage = [self.tabBarItem.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 
            self.tabBarItem.image = [self.tabBarItem.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 
 
        } 
        else{ 
            self.tabBarItem.image = [UIImage imageNamed:选择后图片]; 
            [self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:选择后图片] 
                          withFinishedUnselectedImage:[UIImage imageNamed:默认图片]]; 
        } 
 
 
 
 
 
 
------------------------------------ 
2014/9/25     更新内容 
 
8.模态画面presentModelView背景变成非透明黑色  
目前已经解决,具体参照http://stackoverflow.com/questions/24158820/how-to-present-a-semi-transparent-half-cut-viewcontroller-in-ios-8  
 
2014/8/5更新内容 
1.iOS8_beta5更新后,存在电话Tel:变不好用的问题了。目前正在调查中。 
2.(严重问题)现在的ViewDidLoad的调用机制发生了变化,影响了时序 
 
------------------------------------ 
 
 
1.程序崩溃问题。 
   使用iOS8 demo的系统运行iOS7下的程序,会发生程序崩溃的情况。通常这种崩溃的发生原因是变量对象被提前释放了 
   举例 
-(void)自定义函数 
{ 
ClassViewControllerA * classViewControllerA = [ [ClassViewControllerA alloc] init...]; (这么用生命周期会有问题) 
self presentView classViewControllerA; 
} 
最好是把classViewControllerA 拿到@property里管理 
 
 
2.原来自定义的UIView的布局变大了 
通常这个View是作为Controller的self.view设置的,而且将View自定义了Size,iOS8 demo中会无视这种自定义,强制设置为标准宽高。解决方式是需要重新设置View为FreeForm,或者程序中设置Frame。 
 
 
3.自定义UIActionSheet的SubView无法显示 
   就像UIAlert一样,UIActionSheet上也没有办法乱加东西了。 
 
 
4.子类中的属性名和父类里的冲突了。 
    iOS7前貌似没问题,iOS8 beta不行了。举例 description 字段,NSObject里也有 
 
 
5.地图定位不好用了 
  iOS8修改了位置设置里的内容,增加了一套状态(使用中可用/通常可用),所以以前的CLLcationManage的注册后, 
Delegate接口不响应了。 
  iOS8需要这么设置 
第一步 
    location = [[CLLocationManager allocinit]; 
 
location.delegateself; 
[locationrequestAlwaysAuthorization]; 
第二步 
 
 
在Plist中追加下面两个字段 (必须有,最少一个,内容是系统ALert的文言,文言可为空) 
    NSLocationWhenInUseDescriptionNSLocationAlwaysUsageDescription
第三步 
有了新的Delegate方法。 
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status 
{ 
    switch (status) { 
casekCLAuthorizationStatusNotDetermined: 
            if ([location respondsToSelector:@selector(requestAlwaysAuthorization)]) { 
[locationrequestAlwaysAuthorization]; 
            } 
            break; 
        default: 
            break; 
 
 
    } 
} 
附上调查过程 
https://developer.apple.com/jp/devcenter/ios/library/documentation/LocationAwarenessPG.pdf 
http://www.w3c.com.cn/ios8新特性之基于地理位置的消息通知uilocalnotification 
http://blog.uniba.jp/post/91830563468/ios-8 
 
 
 
6.Bluetooth LE不好用了 
    确认了。5修正好以后,BLE就OK了 
 
 
7.自定义TabbarBar进入present或者HideBottomTabbar后,会变蓝 
    怀疑是IOS8 demo问题 
    目前尝试用这个方法遮挡了一下,但是如果是自定义Tabbbar图片,图片只能显示白色剪影,内容无法显示。  [self.tabBarController.tabBar setSelectedImageTintColor:[UIColor whiteColor]]; 
 
8.模态画面presentModelView背景变成非透明黑色 
   > 怀疑是IOS8 demo问题 
   > 目前iOS8 提出了一个新的Class 但是貌似没用。 
目前已经解决,具体参照http://stackoverflow.com/questions/24158820/how-to-present-a-semi-transparent-half-cut-viewcontroller-in-ios-8 
 
9.UIAlertVIew中message过长的情况下,布局崩溃(iOS7允许内容滑动)。 
   >方法检讨中 
 >参考网页:http://www.cnblogs.com/nathanou/p/3778200.html 
    >※ iOS8  UIAlertView变化为UIAlertController    (和本问题无关) 
已经使用自定义画面实现了。 
 
 
10.Alert内字体变粗体的问题。 
 确认下你的UIAlert创建的地方。如果Title设置为nil,则message字体会变粗体。 

  如果Title设置为@“”,则不会变化。 



转自http://www.cocoachina.com/bbs/read.php?tid=217107&page=1&toread=1#tpc 

 
0 0
原创粉丝点击