`
文章列表
init方法 在init方法中实例化必要的对象(遵从LazyLoad思想) init方法中初始化ViewController本身 loadView方法 当view需要被展示而它却是nil时,viewController会调用该方法。不要直接调用该方法。 如果手工维护views,必须重写该方 ...
    //寫入 - (void)writePlist :(NSString *)name :(NSString *)password {     //取得檔案路徑     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);     NSString *documentsDirectory = [paths objectAtIndex:0];     //documentsDirectory為路徑,可健入以下程式碼以顯示其路徑資訊   ...
      [self.username_tf addTarget:self action:@selector(textEditingChanged:) forControlEvents:UIControlEventEditingChanged];     [self.password_tf addTarget:self action:@selector(textEditingChanged:) forControlEvents:UIControlEventEditingChanged];             -(void)textEditingChanged
    UIImageView *backgroundImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"background.png"]];     self.tableView.backgroundView = backgroundImageView;   //    UIView*backView = [[UIView alloc]initWithFrame:self.view.frame];   //    backView.backgroundColor= [UICol ...
NSString *str0 = @"中文my name is xyxd";   //截取字符串起始点到index为4之间的内容 NSString * to = [str0 substringToIndex:4];   NSLog(@"to = %@",to);   //截取字符index为2 到结尾之间的内容 NSString * from = [str0 substringFromIndex
/* 初始化方法: 1.init返回一个空数组 2.initWithArray从已有数组初始化 3.initWithContentsOfFile//从plist文件加载 4.initWithContentsOfUrl//从网络地址上获取 5.initWithObject用一个对象初始化 6.initWithObjects从多对象初始化 self.theDataArray=[[NSMutableArray alloc]initWithCapacity:5];//指定有五个元素初始化 */ /*打印第一个元素: NSLog(@"the object ...
1. 效率肯定是delegate比nsnotification高。 2. delegate方法比notification更加直接,最典型的特征是,delegate方法往往需要关注返回值,也就是delegate方法的结果。比如-windowShouldClose:,需要关心返回的是yes还是no。所以delegate方法往往包含sh ...
有一位娱乐记者朋友,约我出来聊天。他和我说,受不了在北京生活的巨大反差。一方面,他经常接触各种明星大佬,与他们谈笑风生,出入酒店豪车,来回有人接送。可是另一方面,他蜗在一个十平米的出租屋,解决不了户 ...
分享一下 UITableView的小Demo, 大牛们不要笑话呀,哈哈,如果有不足,或者错误请多多指点呀~~嘻嘻,,,      
文章来源:http://stackoverflow.com/questions/3770019/uiswitch-in-a-uitableview-cell   Setting it as the accessoryView is usually the way to go. You can set it up intableView:cellForRowAtIndexPath: You may want to use target/action to so something when the switch is flipped. Like so:     - (UITable ...
转自:http://blog.csdn.net/sirchenhua/article/details/7415851 首先准备导航栏背景图片,大小 320x44, @2x文件大小640x88,iOS5以后更改背景图片较简单 UINavigationBar *navBar = self.navigationController.navigationBar; #define kSCNavBarImageTag 10 if ([navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) ...
转自:http://raychase.iteye.com/blog/1450079   这篇文字是我好久以来的想法,有一些感悟,有一些激烈的言辞,我很自豪我就是一名程序员,我希望给程序员或者前程序员们带来一点启发。也许你认可我的言辞,也许你不屑我的观点,无论如何,欢迎谈谈你的看法。     让程序员做更多种类的事   为什么有人说小公司锻炼人?在小公司,条件并不那么齐备,很多事情都需要程序员自己做,自己去澄清需求、自己做设计、自己搭建环境、自己测试,甚至自己上线、自己维护(这件事情在我们团队被称为“自己吃自己狗食”)。 然而到了某些公司,在一些正规的流程下,“人”反而显得不那 ...

ios main函数研究

    博客分类:
  • ios
 
  main函数研究 Xcode4.2之前的main函数如下:   int main(int argc, char *argv[]) {     NSAutoreleasePool *pool = [[NSAutoreleasePool
找到Apple内部对MKUserLocation去除偏移的方法。 [MKLocationManager _applyChinaLocationShift:(CLLocation*)arg] 这个方法返回去除偏移后的CLLocation*。 @interface MKLocationManager - (CLLocation*)_applyChinaLocationShift:(CLLocation*)arg; - (BOOL)chinaShiftEnabled; + (id)sharedLocationManager; @end CLLocationManager's D ...
[aString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
Global site tag (gtag.js) - Google Analytics