zoukankan      html  css  js  c++  java
  • IOS开发问题汇总

    7.真机模拟内存警告: [[UIApplication sharedApplication] _performMemoryWarning];

    8.如果没法连接模拟器或真机了:删除DerivedData目录,并且清空回收站,也许还要重启xcode4.

     

    1.运行即崩溃,log下面提示:

    Couldn't register com.myApp.debug with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.Program received signal: “SIGABRT”.

    解决办法:重启iphone/ipad系统

    2.使用Three20框架,加载图片失败,log以下提示:

    TTDASSERT failed: 0 == _queue.maxContentLength contentLength <=_queue.maxContentLength

    解决办法:在appDelegate中加入

    [[TTURLRequestQueue mainQueue] setMaxContentLength:0];

    3.一个object被dealloc之后,其指针还存在,但指向的内存伟空,为了防止其他地方判断该object是否为nil的时候出现bad access问题,就应该立即写一句object = nil;

    4.UINavigationBar的tintColor变了,backItem的颜色不变 的问题解决方案:

    @interface UINavigationController (RefreshBackItem)
    - (void)refreshBackItem;
    @end

    @implementation UINavigationController (RefreshBackItem)
    - (void)refreshBackItem
    {
        UINavigationBar *bar = self.navigationBar;
        UINavigationItem *backItem = bar.backItem;
        NSString *title = [backItem title];
        backItem.title = @"";
        backItem.title = title;
    }
    @end

    5 清除通知中心的本程序消息:
    [application cancelAllLocalNotifications];
    [application setApplicationIconBadgeNumber:0];

    - (BOOL) isiPad 

    {
        return [[self model] isEqualToString:@"iPad Simulator"] || [[self platform] rangeOfString:@"iPad"].location == 0;
    }


    - (BOOL) isRetinaDisplay
    {        
        return  ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] == YES && [[UIScreen mainScreen] scale] == 2.00);
    }

    -(BOOL)isNewiPad 
    {
            return ([self isiPad] && [self isRetinaDisplay]);
    }  

  • 相关阅读:
    《机器学习》第二次作业——第四章学习记录和心得
    机器学习一到三章笔记
    [ML] 第四章学习总结
    [CV] Mnist手写数字分类
    ModelArts (华为GPU/CPU计算云平台)体验
    [DataSturcture] 红黑树求逆序对
    [CV] 边缘提取和角点判断
    [CV] 灰度共生矩阵
    [DataStructure] AC 自动机(Aho–Corasick Automata)
    [GIT] 如何删除git上保存的文件(包含历史文件)
  • 原文地址:https://www.cnblogs.com/xiaouisme/p/2442995.html
Copyright © 2011-2022 走看看