用条件故事板进行切换

我是新的故事板和xcode(使用4.4) 我想要实现一个login条件,如果完成 – segue会工作。 否则,用户应该保持相同的观点。 我创build了2个UIView:ViewController和Bar Controller。 我也创build了从ViewController到Bar控制器的segue,并将其标识符设置为loginSegue为模态。 在LoginViewController.m中,我添加了以下内容: – (IBAction)login:(id)sender { self.email = self.emailText.text; self.password = self.passwordText.text; if ([self.email isEqualToString:@"O"] && [self.password isEqualToString:@"O"]) [self performSegueWithIdentifier:@"LoginSegue" sender:sender]; else [passwordText setText:@""]; } 当我debugging代码 – 我看到,如果电子邮件和密码的情况下跳到其他的不等于O,但仍然发生(转换到新视图)。 我怎样才能防止用户转移到新视图? 顺便说一句,如果我删除if else条件 – 用户被自动转移到下一个视图。 在我看来,当我从一个视图画到另一个视图时,它被configuration在某个地方。

iOS 5:UITabBarItem setFinishedSelectedImage:withFinishedUnselectedImage:不工作/忽略

按照苹果文档 我试图在UITabBarItem上设置自定义完成的选定和未select的图像,如下所示: … DetailViewController *vc1 = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil]; UITabBarItem *vc1i = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:100]; [vc1i setFinishedSelectedImage:[UIImage imageNamed:@"tab_bar_item_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_bar_item_normal.png"]]; [vc1 setTabBarItem:vc1i]; … 基本上发生了什么是TabBar加载就好了,它只是完全忽略标签栏项目定制。 我的目标是iOS5 + 该图像是30×30透明的PNG并存在于项目中。 无法弄清楚我在这里忽略了什么,但必须是一些东西! 这是在tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath中调用的tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath方法,ala Ray Wenderlich的教程 有人有主意吗? 谢谢!

iOSfind平均速度

我已经有东西显示我目前的速度和最高速度(下面的代码中的最大速度)现在我想做的东西,计算我的核心位置的平均速度。 怎么样? 谢谢。 – (void)locationUpdate:(CLLocation *)location { speedLabel.text = [NSString stringWithFormat:@"%.2f", [location speed]*2.236936284]; 这是最高速度的浮子 float currentSpeed = [location speed]*2.236936284; if(currentSpeed – maxSpeed >= 0.01){ maxSpeed = currentSpeed; maxspeedlabel.text = [NSString stringWithFormat: @"%.2f", maxSpeed]; }

animationiOS与声音文件

我有一些需要在非常特定的时间出现在屏幕上的animation,这些animation存储在SQLite数据库中。 我打算做的是使用nstimer来保持时间,并在达到特定时间时popupanimation。 我想使用NSTimer计数声音文件和animation的持续时间,然后当达到某些点popup一个屏幕上的animation。 问题是设置的时间是这样的55.715000秒,所以非常准确,这些都需要与animation播放的音轨同步。 首先,这甚至是可能的,其次,我怎样才能比较这样的具体时间,我似乎面临的问题是代码运行不够快,时间跳跃超过.001秒。 我没有openGLES或Cocos2d的知识,学习这些在时间尺度上是不可行的。

如何通过分别提供密钥文件来播放m3u8encryption的播放列表?

我有一个m3u8播放列表文件(让我们称之为素数),它指向另一个播放列表文件,该文件又具有带有密钥文件URL的ts URL。 使用MPMoviePlayer我目前可以播放prime m3u8文件。 这些段使用AES-128位encryption进行encryption,密钥文件位于最终的m3u8文件中。 有没有一种方法可以提供最终的m3u8文件,并告诉应用程序使用本地密钥文件来解密video,所以我不必公开发布密钥文件。 这与这个SO问题有些相关

UIWebView没有完成加载?

我有一个webview在我的application.It加载大部分的页面和函数webViewDidFinishLoad调用时加载完成。但是一些页面加载不完成,虽然页面似乎加载。 在这些情况下既没有 – (void)webViewDidFinishLoad:(UIWebView *)webView也没有(void)webView:(UIWebView *)webView didFailLoadWithError被调用。 例如:转到网站http://www.mynevadacounty.com/ ,当你点击任何项目,如移动页面加载不完成在UIWebView。 这可能是什么原因? 编辑:我试图加载这些网站的大多数是SharePoint站点

我怎么能添加splitview到我的基于视图的应用程序在iPad编码

我使用基于View的应用程序启动我的iPad应用程序。 在前两个视图我添加表视图。 现在作为第三个视图我想添加splitView到视图,为此我将splitview控制器添加到我的xib文件。 我怎么编写编程部分。 请使用任何有用的链接或源代码。 I am using view based class like as follows: – (void)viewDidLoad { [super viewDidLoad]; } – (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // eg self.myOutlet = nil; } – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } 我在哪里实现代码? 提前致谢。

如何在iphone SDK中更改date格式

我收到Webservices Date的回复,如“2012-08-17T00:00:00”。 我只想显示date,如17-08-2012。 如何更改date格式和删除那个时间…

当在PFQueryTableViewController中删除单元格和时,它会在 – 中断言失败

我愿意删除单元格,并显示在PFQueryViewController的单元格中重新加载tableView。 但是,当我删除和刷新TableView,我得到错误:“***断言失败 – [UITableView _endCellAnimationsWithContext:],/ SourceCache / UIKit_Sim /UIKit-3318.93/UITableView.m:1582” 在这个错误代码之后,我检查Parse中的数据,并且删除的单元格的数据被删除。 我看了这个链接,但我不知道为什么要在我的代码断言。 当我使用[self loadObjects]。 https://parse.com/questions/refresh-data-in-a-pfquerytableviewcontroller if (editingStyle == UITableViewCellEditingStyleDelete) { PFObject * object = [self.objects objectAtIndex: indexPath.row]; [object deleteInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (succeeded) { [self loadObjects]; }else{ } }]; 你能给我一些build议吗?

NSURLErrorDomain错误-1021

我正在开发一个应用程序,我集成了Dropbox。 login正确完成,我也能够在dropBox中创build文件夹。 但是,当我尝试加载文件,我得到错误 以下错误我越来越 error making request to /1/files_put/dropbox/Info.plist – Error Domain=NSURLErrorDomain Code=-1021 "The operation couldn't be completed. (NSURLErrorDomain error -1021.)" UserInfo=0x6859bc0 {destinationPath=/Info.plist, sourcePath=/Users/bcod/Library/Application Support/iPhone Simulator/5.0/Applications/0E1EE43C-8F6B-40FA-8696-D3992DA2DCE5/DBRoulette.app/Info.plist} 当我创build文件夹时,我没有收到这个错误。