Chinaunix首页 | 论坛 | 博客
  • 博客访问: 377618
  • 博文数量: 466
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-16 13:59
文章分类

全部博文(466)

文章存档

2015年(466)

我的朋友

分类:

2015-03-16 14:33:01

1> Xcode 断点无效 问题解决


点击 Xcode以下菜单


XCode

   Preferences

        Debugging

              Symbol Lazy Options

                      把下面那个选项(load symbol lazily)去掉,


重新编译,再设个断点就可以试试看是否能调试。


2> 为游戏添加 OpenFeint 模块时,真机环境 出现 mi_cmd_stack_list_frames: Not enough frames in stack 错误。

解决方法: 在项目的 target 配置中,将 UIKit MapKit 库 修改为 Weak 状态

操作步骤如下:

 * Select 'Targets' in the Groups & Files pane.
       * Right click your target and select Get Info.
       * Select the 'General' tab.
       * Under 'Linked Libraries' change the following libraries from 'Required' to 'Weak'
           * UIKit
           * MapKit

3> 弹出一个信息矿代码

NSString* message = @"this is my test!";

[[[[UIAlertView alloc] initWithTitle:@"message title!" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] autorelease] show];


4> 定时器的使用


NSTimer *animationTimer; // 定时器

NSTimeInterval animationInterval= 1.0 / 60.0;     // 设置屏幕刷新的频率, 一秒 60


// 启动定时器

animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(call_back_fun) userInfo:nil repeats:YES];


// 回调函数

- (void) call_back_fun 

{

// do something....

}


// 停止定时器

animationTimer = nil;



5> NSString 和 C string 之间的转换

NSString *nsStr = @"zhangsan";

char* cStr = [nsStr UTF8String];



6> 屏幕分辨率:


iphone 3Gs: 320x480

iphone 4: 960x640

ipad: 1024x768


7> 游戏异常退出,终端显示 : Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")


很可能是由于内存不足导致的。

真机环境中的可用内存,在不同的情况下是不一致的,因此一定要保证系统剩余一定内存空间。 防止异常情况的出现。


8> 查看游戏真机内存情况,调试内存泄露


真机调试怎么看iPhone内存使用情况 (Instruments)

Run->Start with Performance Tool-> object Allocations  ( or leaks)


9> 在真机上调试时出现“Error launching remote program: failed to get the task for process xxx"的解决方案

 调试程序的时候,设置证书签名的时候,不要使用  distribution 证书, 使用 development 签名证书就可以正常调试应用程序了。

使用    distribution 证书 不可以调试程序,但是可以正常安装游戏 到真机上。

阅读(246) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~