Xcode Error:loaded some nib but the view outlet was not set解决

0

本文作者:xjtudll  发布于:2014-4-30  分类:技术心得  点击:

当使用 initWithNibName 函数, 并使用由nib文件生成的ViewController 的view属性时候,遇到这个问题。

clip_image002

...

Xcode:failed to get the task for process XXX 解决办法

1

本文作者:xjtudll  发布于:2014-4-27  分类:技术心得  点击:

问题:

    iOS真机调试程序,报如下错误信息:failed to get the task for process XXX

原因:

...

NSTextfield只允许输入数字

0

本文作者:xjtudll  发布于:2014-4-26  分类:技术心得  点击:

   


    三个TextField分别是watchHourLabel,watchMinuteLabel,watchSecondLabel。只允许输入数字
   使用NSNumberFormatter可以实现这个效果。
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
    [watchHourLabel setFormatter:formatter];            //只允许输入数字
    [watchMinuteLabel setFormatter:formatter];
    [watchSecondLabel setFormatter:formatter];

 

ios 获取应用程序的名称和版本号

0

本文作者:xjtudll  发布于:2014-4-23  分类:技术心得  点击:

应用程序的名称和版本号等信息都保存在mainBundle的一个字典中,用下面代码可以取出来。
 
NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];      
NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];       
NSString *appName =[infoDict objectForKey:@"CFBundleDisplayName"];       
NSString *text =[NSString stringWithFormat:@"%@ %@",appName,versionNum];

NSString 字符串的合并

0

本文作者:xjtudll  发布于:2014-4-22  分类:技术心得  点击:

 
NSString* string; // 结果字符串       
NSString* string1, string2; //已存在的字符串 
                     
 下面这三种方法可以让字符串合并:  
string = [NSString initWithFormat:@"%@,%@", string1, string2 ];               
string = [string1 stringByAppendingString:string2];              
string = [string stringByAppendingFormat:@"%@,%@",string1, string2];

第二个方法更有效率。
 
Page 1 of 1 « 首页...«1»...尾页 »