Tag: ios4

iOS:比较这两个图像

首先是我所拥有的简短描述 我的iOS应用程序正在生成相同大小和格式的图像。 每次生成图像时,都应该将其上传到某个Web服务中。 我想做的事情基本上是尽可能减less互联网stream量。 所以基本上我想知道你的build议如何做到这一点? 我select,我虽然是发送第一个图像到服务器,然后第二个图像的差异与第一个。 所以基本上我可以用这个方法保留一些stream量。 所以也想知道有没有人做过这样的东西,你是怎么实现的? 即什么第三方库等 提前致谢。

如何使用datepicker在button上显示选定的date?

当我点击我的button能够显示dateselect器成功。但是当我从dateselect器selectdate我无法显示在UIbutton上选定的date。 PLZ帮助我 这是我的代码: -(IBAction)btnDateClicked:(id)sender { UIActionSheet *actionSheet1 = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; [actionSheet1 setActionSheetStyle:UIActionSheetStyleBlackTranslucent]; CGRect pickerFrame = CGRectMake(0, 40, 0, 0); UIDatePicker *pView=[[UIDatePicker alloc] initWithFrame:pickerFrame]; pView.datePickerMode=UIDatePickerModeDate; NSDateFormatter *df=[[NSDateFormatter alloc] init]; [df setDateFormat:@"MM/dd/yyyy"]; // NSDate *date=[df dateFromString:self.hController.fromDateTime]; // [pView setDate:date animated:YES]; self.datePicker=pView; [actionSheet1 addSubview:self.datePicker]; [pView release]; UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]]; […]

coreImage iOS 4.3.3崩溃

家伙,我有iOS应用程序,运行良好的ios5.0,但在4.3.3它崩溃,写这个控制台: dyld: Library not loaded: /System/Library/Frameworks/CoreImage.framework/CoreImage Referenced from: /Users/IvanTrufanov/Library/Application Support/iPhone Simulator/4.3.2/Applications/99C63A08-CC3E-49B7-A27D-1352D61C7C4F/habr.app/habr Reason: image not found 你有什么想法吗? 什么可以是原因?

使用animation调整UIWebView的大小时发生

我一直在努力这一段时间,并没有find一个解决scheme。 我正在使用animation通过beginAnimations:调整UIWebView beginAnimations:和commitAnimations 。 一切顺利,除了当resize时尝试使UIWebView变大。 让我更清楚一点。 假设我的UIWebView的当前帧是(0, 0, 320, 300) UIWebView (0, 0, 320, 300) 。 然后,我尝试使用以下命令将其大小调整为(0, 0, 320, 340) : [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [self.webView setFrame:(CGRectMake(webView.frame.origin.x, webView.frame.origin.y, webView.frame.size.width, 340))]; [UIView commitAnimations]; 通过这样做,我预计UIWebView会下降40个像素,但实际上会稍微增加一些(大约10 – 20像素),并且只有在达到预期的位置后才会降低到50 -实际上是60像素)。 有谁知道如何解决? 我想要做的是当UIWebView的底部调用方法被调用的时候,所以如果有其他的select来完成它,我会很乐意尝试。 非常感谢。

读取'CSV'文件 – 无法读取包含loongstring的csv文件

我正在使用以下方法来读取.csv文件。 它正常工作,包含正常string,数字等csv文件。 但是它没有读取包含长string的csv文件(例如:描述5,6行)。 有这样的技术难度吗? 您的帮助是高度赞赏。 -(void)readTitleFromCSV:(NSString*)path AtColumn:(int)column { //arrBreeds = [[NSMutableArray alloc]init]; NSMutableArray *arrTemp = [[NSMutableArray alloc]init]; NSString *fileDataString=[NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; NSArray *linesArray=[fileDataString componentsSeparatedByString:@"\n"]; // preparing array with questions and answers for(int i=0; i<[linesArray count];i++){ [arrTemp addObject:[[linesArray objectAtIndex:i] componentsSeparatedByString:@","] ]; } NSLog(@"ArrBreeds %@", arrTemp); }

; 行为奇怪

我有一个通用的应用程序,支持iPad的所有方向,只有iPhone / iPod的potrait。 我的代码看起来有点像这样: @implementation UIViewController ( interfaceOrientationHack ) – (void) shouldAutorotateToInterfaceOrientation: ( UIInterfaceOrientation ) toInterfaceOrientation { if( iPad ) { return YES; } else if( toInterfaceOrientation == UIInterfaceOrientationPotrait ) { return YES; } else return NO; } @end 从我的一个控制器中,我启动了一个导航控制器作为模态视图控制器 [ self presentModalViewController: c animated: YES ]; 目前的问题是,模态控制器在方向上正确启动,但是当我改变方向时,模态控制器不改变其方向,其余的控制器都正常工作。 任何帮助将非常感激。 提前致谢。

sorting多个字典的数组

我的数组包含每个数组对象的三个字典。 { avg = { avg1 = 50; avg2 = 60; }; posts = { alcoholContent = 450; name = "BBB"; origin = United States; }; reviews = { rev1 = "Test review 1"; rev2 = "Test review 2"; }; } { avg = { avg1 = 30; avg2 = 20; }; posts = { […]

如何dynamic添加UIButton到UITableViewCell?

我想dynamic地添加一个UIButton到一个表格单元格,请看下面的要求。 当用户select一个单元格时,我只是在调整表格单元格的高度 -(void) tableView:(UITableView*) tableView didSelectRowAtIndexPath:(UIIndexPath*) indexPath { selIndPath = [indexPath retain]; [self.tableView beginUpdates]; [self.tableView endUpdates]; } 上面的方法强制tableView调整所选行的高度。 但是,当我在上面的方法中添加UIButton,该button不可见。 我对[self.tableView reloadData]不感兴趣; 任何帮助不胜感激。 ** * ** 编辑 * ** * *** – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (selIndPath && selIndPath == indexPath) { //UITableViewCell* cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; // UIButton* btn = (UIButton*)[[cell contentView] […]

如何将构build发送到已configuration的远程人员的iPhone

我们为iPhone开发configuration了3个设备。 2个开发人员和一个经理电话。 当经理曾经在这里,我们曾经把他的手机连接到我们的Mac,并与他分享的build设。 他现在正在远程工作。 我现在怎么把这个build筑物给他呢? 他的设备已经configuration好了,他现在正在运行旧版本的应用程序(正在开发中)。 我们需要用新版本更新他的手机。 我们正在使用XCode4.2和Lion。 请帮忙。

如何dequeueReusableCellWithIdentifier:对待不同的indexPath?

让我们看看一些标准的tableview代码 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; static int count = 0; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; NSLog(@"count %d", count++); } // Configure the cell… cell.textLabel.text = [array objectAtIndex:indexPath.row]; return cell; } 如果我们在数组中有10个项目,那么它将为每个indexPath.row分配10个单元格 我的问题是函数reuseIdentifier:CellIdentifier如何知道不同的行?