摘要: - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;{ if ([string isEqualToString:@"n"]) { return YES; } NSString * toBeString = [textField.text stringByReplacingCharactersInRange:range withString:string]; //... 阅读全文
posted @ 2014-01-09 16:14 菜鸟程序猿 阅读(547) 评论(0) 推荐(0) 编辑
摘要: - (IBAction)touchReadButton:(id)sender { NSData *jsonData = [[NSData alloc] initWithContentsOfFile:JSON_PATH]; NSError *error = nil; id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:&error;]; ... 阅读全文
posted @ 2013-12-16 14:57 菜鸟程序猿 阅读(345) 评论(0) 推荐(0) 编辑
摘要: for (UIView * thebtn in [self.view subviews]) { if ([thebtn isKindOfClass:[UIButton class]]) { //***改变字体颜色 [(UIButton *)thebtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; //***改变背景 [(UIButton... 阅读全文
posted @ 2013-12-16 14:43 菜鸟程序猿 阅读(336) 评论(0) 推荐(0) 编辑
摘要: /** * @brief 冒泡排序法 * * @param arr 需要排序的数组 */-(void)BubbleSort:(NSMutableArray *)arr{ // 取第一个与其邻接的对比,若大则交换 for (int i=0; ii; j--) { int temp1 = [[arr objectAtIndex:j]intValue]; int temp2 = [[arr objectAtIndex:j-1]intValue]; if (temp1 temp2) // 从大到... 阅读全文
posted @ 2013-12-06 16:38 菜鸟程序猿 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 需要导入如下frameworklibxml2.2.dyliblibz.1.2.5.dylibMobileCoreServices.frameworkSystemConfiguration.frameworkCFNetwork.frameworkHeader Search Paths 加入/usr/include/libxml2 阅读全文
posted @ 2013-12-02 10:03 菜鸟程序猿 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Setthe UIViewControllerBasedStatusBarAppearancetoNOin theInfo.plist.InViewDidLoadmethod or anywhere, where do you want to change status bar style:[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 阅读全文
posted @ 2013-10-09 11:30 菜鸟程序猿 阅读(221) 评论(0) 推荐(0) 编辑
摘要: - (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. self.title = @"拷贝文件到Sandbox"; //文件类型 NSString * docPath = [[NSBundle mainBundle] pathForResource:@"save1" ofType:@"dat"]; // 沙盒Documents目录// NSString * appDir = [NSSearchPathFor 阅读全文
posted @ 2013-10-08 13:57 菜鸟程序猿 阅读(5862) 评论(0) 推荐(0) 编辑
摘要: - (void)requestMapListData{ NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@""]]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; request.timeOutSeconds = 20.f; [request startAsynchronous];}- (void)requestFinished:(ASIHTTPReques... 阅读全文
posted @ 2013-08-30 15:53 菜鸟程序猿 阅读(372) 评论(0) 推荐(0) 编辑
摘要: textField.leftView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 8, 0)] autorelease]; textField.leftView.userInteractionEnabled = NO; textField.leftViewMode = UITextFieldViewModeAlways;// Text 垂直居中textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; 阅读全文
posted @ 2013-08-27 09:41 菜鸟程序猿 阅读(9854) 评论(1) 推荐(2) 编辑
摘要: UIView *bgColorView = [[UIView alloc] init];[bgColorView setBackgroundColor:[UIColor redColor]];[cell setSelectedBackgroundView:bgColorView];[bgColorView release]; 阅读全文
posted @ 2013-08-20 18:09 菜鸟程序猿 阅读(333) 评论(0) 推荐(0) 编辑