`
简单的茶
  • 浏览: 85657 次
  • 性别: Icon_minigender_2
  • 来自: 昆明
社区版块
存档分类
最新评论
文章列表
原因:Xcode 6 默认新建的启动页面为 LaunchScreen.xib,系统通过检测是否有这个文件,来判断 app 是否支持 iphone 6 & 6 plus.       如果要支持 iOS 7,还必须添加 Launch Image assets.       如果 app 要支持 iOS 7但是没有设置 Launch image assets ,在 iOS 7 上运行上下两边就会出现黑边。 解决办法:      Target -> General Tab -> App Icons and Launch Images -> add launch im ...
1. 新建文件,选择 User Interface->View-> MyCell, 生成 MyCell.xib 2. 打开 MyCell.xib ,删除自带的 View 3. 拖拽一个 Cell 到 该 xib       通过以上步骤就生成了根  view 为 UITableViewCell 的 xib 文件
1. XCode 提示 ”set a breakpoint in malloc_error_break to debug “时,如何设置 malloc_error_debug?     solution:      Step 1: Set a breakpoint on malloc_error_break() by opening the Breakpoint Navigator (View->Navigators->Show Breakpoint Navigator or ⌘7), clicking the plus button in the lower left corne ...
思路:用递归的方法;第一步为判断0和最后一个字符是否一样 实现:     package palindrome; public class Palindrome { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub // String testStr = "abcdedcba"; String testStr = "abcdecba"; System.out.println( ...
题目:     写一个函数,将一个字符串变成倒序,结果存于原字符串,不得额外分配空间保存字符串。例如:abcdef 经变换后为 fedcba 算法思路:      采用递归算法,字符两两交换。 package reverseString; public class ReverseString { /** * @param args */ public static void main(String[] args) { String test = "12345"; System.out.println(reverse(test, 0, (test ...
    “could not launch app name”这个问题经常遇到,很讨厌。终于集齐了可以解决该问题的方法,要么一种方法即可以解决问题,要么这些方法得齐上阵。      1. 删除机器或模拟器上已经安装的该 app;      2. 删除 Derived Data: Shift+Command+2, 在 Projects 栏目下,右侧找到该工程,然后在左侧点击 Delete 按钮,删除该工程的 Derived Data.      3. 删除 Required device capability,在 -info.plist 文件中。      Good luck!
The iOS simulator does not duplicate some of the low-level parts of iOS. For example, it uses the host OS X's kernel instead of trying to virtualize the iOS kernel. The iOS simulator requires that these subsystems look sufficiently similar between the simulated iOS and the host OS X. When a new host ...
There are 2 method to check whether a project is using ARC. 1. Select the project, open Build Settings. Look for Objective-C Automatic Reference Counting in the Apple LLVM Compile - Language section. 2. Try sth like this in code:      [[[NSObject alloc] init] ]autorelease];    If U get an error :AR ...
A Note About kAudioSessionIncompatibleCategory Error on iOS 5 and 6 There is bug apparent on both iOS 5 and 6 (but not iOS 7) that manifests in apps that use the PlayAndRecord audio session category under certain multitasking conditions. The issue is triggered reliably via the following steps: Open ...
Now, in order to tell your app to redirect the NSLog() outputs to a file, you should do something like this: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *fileName =[NSString string ...
    iOS 上的 framework 和 .a 库一般会同时支持多个 architecture, 比如 i386, armv7, armv7s 等。     为了减小程序的尺寸,可能需要裁剪掉不需要的 architecture, 这时就需要使用 lipo 命令给程序瘦身。      Step1: 查看目标库文件支持的 architecture, 两个选择                 1.1 lipo -info 目标库文件                  1.2 file 目标库文件     Step2: 生成只支持一个 architecture 的 库文件               ...
     在真机上,只能往  Documents 和 tmp 目录下写文件。因为文件夹Resouces是只读的,无法写入。document 和temp文件夹的东西才是可读写的。       在模拟器上没有这个限制。       血泪教训啊!

setValue:forUndefinedKey

    博客分类:
  • iOS
 
   使用 Storyboard 创建并管理 UI 时,在运行 app 的时候出现了 2013-10-15 09:21:03.212 TestMSR[610:11303] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MainViewController 0x7557c30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key star.'      ...
原因: 1. 创建 Empty Application 时没有 Using Storyboard 选项,需要手动创建 MainStoryboard。           2. Changed Main Storyboard in Target's Summary view           3. For an Empty Application, the default implementation of  didFinishLaunchingWithOptions is :   - (BOOL)application:(UIApplication *)application didFini ...

OC 和 C++ 混编

    博客分类:
  • iOS
原文出处:      http://blog.csdn.net/fengsh998/article/details/8010696 个人要点总结:       在 Xcode 中,Compile Sources As 的默认选项为 According to File Type。 不改变该设置的前提下,如果要在某个类中使用 C++ 代码,则必须把该类的后缀 由 .m 改为 .mm.        如果把 Compile Sources As  改为 Objective-C++,则无需把 类的后缀改为 .mm。
Global site tag (gtag.js) - Google Analytics