Tag: ipad

iOS开发:为什么我的NSURLConnection只有一些用户出现“错误的URL”错误?

我有一个iOS应用程序,它从Heroku上托pipe我的Rails 3应用程序请求JSON数据,并且在我的设备和许多其他用户(除了一个用户)上效果很好。 我有一个用户告诉我,我的应用程序无法检索JSON数据,所以我让她给我发送一些日志数据,日志显示NSURLConnection委托方法didFailWithError被调用,错误描述为“bad URL” 。 为什么会发生这个错误,为什么它只发生在一些设备而不是所有设备上? 这是我的代码, -(void)getTournamentInfoWithUsername:(NSString*)username { NSString *urlString = [NSString stringWithFormat:@"http://myapp-tourney.heroku.com/tournaments/next.json?username=%@", username]; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30]; [self setUrlConnection:[[NSURLConnection alloc] initWithRequest:request delegate:self]]; } – (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error { [MyLog logError:[NSString stringWithFormat:@"%@ – %@ – %@ – %@", [error localizedDescription], [error localizedFailureReason], [error localizedRecoveryOptions], [error localizedRecoverySuggestion]]]; } […]

将自定义select器添加到UIBarButtonItem

我是一个iOS新手。 我有一个导航栏button,点击时应执行我自己的function。 什么是最好的方法来做到这一点? UIBarButtonItem *doneBarButtonItem=[[UIBarButtonItem alloc] init]; doneBarButtonItem.title=@"Done"; self.navigationItem.rightBarButtonItem = doneBarButtonItem; [doneBarButtonItem release];

在另一个应用中打开文件

我的应用程序需要在其他应用程序中打开某些文件types,例如Dropbox应用程序,它可以列出可以打开特定types文件的已安装应用程序。 如何获得应用程序列表?

iPhone上的networking活动监控

我已经工作了5天,试图学习和实施iPhone上的networking监视器。 我看着苹果公司的netstat代码,而且我的头发损失了25%。 我findJB设备的链接,但我需要它在非JB设备上执行。 (无论苹果是否在App Store上接受)。 我发现了一些有用的链接: 如何获得tcp udp在iPhone上打开端口列表 (我无法parsing在这个问题中返回的数据:() iPhone上的数据使用情况 sysctlbyname buf返回types (我不是一个networking人..不能理解这一个,可能是你们可以帮助:)) TCP / UPD端口列表 我可以说我从第一个链接得到了一些东西。 你们能帮我parsing数据吗? 有没有其他的方法来实现这个?

iOS,退出后台时重新启动animation

当我的应用程序出来的背景animation已经停止。 这是正常的。 但我想从当前状态重新开始我的animation。 我如何做到这一点,而不是在我所有的地方。 [UIView animateWithDuration:60 delay:0 options:(UIViewAnimationOptionCurveLinear |UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState) animations:^{ [bg setFrame:CGRectMake(0, 0, 1378, 1005)]; } completion:nil]; 我试图在animation前面放置一个框架,但是这只是让它抓拍。 [bg setFrame:CGRectMake(0, 0, 1378, 1005)]; 有任何想法吗?

如何从iPhone上传video到服务器?

-(IBAction)uploadToServer :(id)sender { NSString *str1=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"intro.mp4"]; NSLog(@"str1=%@",str1); NSString *escapedUrlString = [str1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSLog(@"escapedUrlString=%@",escapedUrlString); NSURL *videoURL = [NSURL URLWithString:escapedUrlString]; NSLog(@"videoURL=%@",videoURL); NSData *newdata = [NSData dataWithContentsOfFile:escapedUrlString]; webdata=[NSData dataWithData:newdata]; NSLog(@"webData = %@",webdata); [self post:webdata]; } – (void)post:(NSData *)fileData { NSData *videoData = fileData; NSString *urlString = @"http://rompio.com/web_service/web.php?method=upload_video&user_id=4"; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:[NSURL URLWithString:urlString]]; […]

PhoneGap / iOS上的SQLite数据库 – 超过5MB的可能

我有点困惑在iOS上的PhoneGap本机应用程序中使用SQLite的限制。 你可以阅读关于5MB存储的限制和事实,你的iPad可以要求你增加存储的许多职位。 现在我已经设法使用通常的Phonegap-Storage-API将近7000行插入到SQLite数据库中。 相应的db文件大小为26 MB。 下面的select语句“select * from”工作,并显示数据库的内容。 我已经在模拟器和设备上完成了。 我没有得到提高存储的问题。 怎么可能? 我误解了什么? Phonegap中的SQLite dbs是否真的有5mb的限制? 我正在使用Phonegap 1.2和iOS 5。

iOS – 具有故事板的UISplitViewController – 多个主视图和多个详细视图

我正在尝试使用UISplitViewController和storyboard来组合一个iPad应用程序。 主视图从导航控制器链接到6个菜单选项的表格视图开始。 表格中的每个单元格将不同的表格视图控制器推入导航堆栈。 这对主视图工作正常。 每个主视图都有一个表格列表,单击时需要在详细信息窗格中显示不同的视图控制器。 我目前已经做了一个segue设置为'replace'和'细节拆分',这是第一次点击一行,但一旦你点击主视图中的另一行,或旋转设备,然后应用程序崩溃与EXC_BAD_ACCESS。 我相当确定我的问题是如何为UISplitViewController设置代理。 我很困惑,当我有多个主VC和多个VC细节时,应该如何使用它。 代表代码应放在哪里 – 主人还是细节? 我必须在每个视图控制器中实现UISplitViewControllerDelegate协议事件吗? 任何帮助赞赏。

如何从Popover中的button中解除UIPopover

我试图从Popover中的一个button解雇一个UIPopoverViewControler。 另外我希望它把数据传回主视图。 我有一个modalViewController工作,但不是一个Popover。 有谁知道我可以做到这一点? //酥料饼 – (IBAction) save:(id)sender { if ([self startDateIsValid] && [self endDateIsValid]) { [[self parentViewController] setDatesForEvent:startDate eventEndDate:endDate allDay:[allDaySwitch isOn]]; [self dismissModalViewControllerAnimated:YES]; } } // AddEventViewController_iPad #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "dateViewPopOverViewController_iPad.h" @interface AddEventViewController_iPad : UIViewController <UITableViewDelegate,UITableViewDataSource, MFMailComposeViewControllerDelegate, UITextFieldDelegate, UIAlertViewDelegate,UIPopoverControllerDelegate,UINavigationControllerDelegate,UIPopoverControllerDelegate,ABPeoplePickerNavigationControllerDelegate, ABNewPersonViewControllerDelegate,DismissPopoverDelegate> { // datePopover #import <UIKit/UIKit.h> #import "AddEventViewController_iPad.h" @protocol DismissPopoverDelegate <NSObject> – (void) […]

为什么Safari Mobile在处理iOS 8上的许多input字段时遇到了问题

iOS 8.0 / 8.0.1 / 8.0.2有这个问题。 我有一个包含70个简单文本input的页面: <input class="" type="text"> 在iOS 7上,页面没有问题。 但在iOS 8上,select并在字段中input会导致iPad变得缓慢和迟缓。 你可以在这个jsFiddle中看到一个问题的例子 有谁知道这个问题的解决?