Tag: ios7

如何从iOS应用程序打开twitterlogin页面

我正在开发一个叽叽喳喳应用程序,我必须在应用程序中创buildlogin页面就像Facebooklogin对话框come.I尝试STTwitter使用这个我们必须添加twitter的用户名和密码在settings.Is有任何方式来logintwitter从iOS应用。 这是我的代码 – (IBAction)loginWithiOSAction:(id)sender { self.twitter = [STTwitterAPI twitterAPIOSWithFirstAccount]; _loginStatusLabel.text = @"Trying to login with iOS…"; _loginStatusLabel.text = @""; [_twitter verifyCredentialsWithSuccessBlock:^(NSString *username) { _loginStatusLabel.text = username; } errorBlock:^(NSError *error) { _loginStatusLabel.text = [error localizedDescription]; }]; }

订阅ReactiveCocoa中的networking电话信号的正确select是什么?

我是ReactiveCocoa世界的新手,在阅读了ReactiveCocoa的最佳实践之后,我知道我需要"avoid explicit subscriptions and disposal"但是在所有关于networking和ReactiveCocoa教程中,我看到了相同的模式:创build信号(使GET或POST请求到服务器,parsing结果, sendNext , sendCompleted ) – > subcsribeNext (做UI的东西或其他与结果) – > subscribeError 。 所以我们看到这里有一个明确的订阅,我认为这是不好的。 有没有一些更正确和概念上纯洁的方式来做这个共同的事情? rac_liftSelector:withSignals:或者类似的东西? 或者当我们处理networking调用和AFNetworking我们应该总是使用这种标准的订阅模式? 详细的解释将是非常有帮助的。 EDITS: 在我的应用程序中,我主要获取调用,其中一些是依赖的,其他人是单一的(绝大多数),如login或fetchWhatever ,或后postWhatever 。 所有的API调用,我用这样的模式构造( self – 是我的API manager NVMAPI类是AFHTTPSessionManager子类): -(RACSignal*)loginUserWithEmail:(NSString *)email andPassword:(NSString *)password { __block NSURLSessionDataTask* task; return [[RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) { task = [self GET:kUserLoginEndpoint parameters:@{@"email": email, @"password": password} success:^(NSURLSessionDataTask […]

UICollectionView在删除节时崩溃

当使用这个代码 – (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { [self removeCompany:companySelectedInActionSheet]; NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex: indexPathSelectedInActionSheet.section]; NSLog(@"IndexSet to delete from collection view: %@",indexSet); [self.collectionView deleteSections:indexSet]; } } 我的应用有时会崩溃(10%的时间)与此错误: *** Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-2903.2/UICollectionView.m:3700 有什么想法可能是错的? 在删除之前提交的操作表是一个潜在的问题吗? 在删除集合视图部分之前,是否需要手动解除它?

iOS – 从代码运行第三方导航应用程序

我是新来的iOS,我想从我自己的应用程序运行导航应用程序。 现在我只是使用这个代码: – (void)navigationButtonTap:(id)sender { Class mapItemClass = [MKMapItem class]; if (mapItemClass && [mapItemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) { // Create an MKMapItem to pass to the Maps app CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake([actualPlace.latitude doubleValue], [actualPlace.longitude doubleValue]); MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil]; MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark]; [mapItem setName:actualPlace.Name]; // Pass the map item to the […]

如何在iOS 7上添加对UITextView的中文键盘支持?

如何在iOS 7上添加对UITextView中文键盘支持? 目前我正在使用下面的代码。 但只适用于标准尺寸的键盘。 它只调整UITextView的主键盘而不需要额外的中文面板。 bool keyboardIsShown; float keyboardDelta; – (void)keyboardWillShow:(NSNotification*)aNotification { if (!keyboardIsShown) { keyboardIsShown = true; NSDictionary* userInfo = [aNotification userInfo]; CGSize keyboardSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; if (is_Landscape) { keyboardSize = CGSizeMake(keyboardSize.height, keyboardSize.width); } keyboardSize.height -= tabBarController.tabBar.frame.size.height; CGRect viewFrame = myUITextView.frame; keyboardDelta = keyboardSize.height; viewFrame.size.height -= keyboardDelta; NSTimeInterval animationDuration; UIViewAnimationCurve animationCurve; [[userInfo […]

检测数组中的string对象是否与任何命令相匹配

请耐心等待,阅读我目前的情况。 我的问题在下面。 我的应用程序需要语音input,并成功地将单词匹配在一起形成一个单词或一组单词 – 称为短语; 无论是name , action , pet还是time 。 我有一个允许的短语的主列表,并存储在各自的数组中。 所以我有以下数组validNamesArray , validActionsArray , validPetsArray和validTimeFramesArray 。 每当用户停止说话时,都会返回一组新的短语。 NSArray *phrasesBeingFedIn = @[@"CHARLIE", @"EAT", @"AT TEN O CLOCK", @"CAT", @"DOG", "URINATE", @"CHILDREN", @"ITS TIME TO", @"PLAY"]; 知道它可以有以下组合创build一个命令: COMMAND 1: NAME + ACTION + TIME FRAME COMMAND 2: PET + ACTION COMMAND n: n + n, […]

文本框被键盘隐藏

我用registry格做了一个应用程序。 当选中此格式的文本框时,软键盘将隐藏该文本框。 如果我离开它,因为它是用户无法看到他在input时input。

与Splitview里面的Popover

我想用UISplitViewController里面编程创build一个UIPopoverController。 问题在于主视图覆盖了细节视图。 看起来主视图popup了细节视图。 这意味着我可以看到,硕士和细节,但分裂是不正确的。 看看这里: http : //i.stack.imgur.com/En70W.png 任何想法如何解决? 谢谢 .m文件 UISplitViewController *customSplitVC = [[UISplitViewController alloc] init]; ListViewController *listViewController = [[ListViewController alloc] init]; listViewController.title = @"Master"; listViewController.content = self.myContent; UINavigationController *masterNC = [[UINavigationController alloc] initWithRootViewController:listViewController]; masterNC.view.frame = CGRectMake(0, 0, 500, masterNC.view.frame.size.height); DetailViewController *detailViewController = [[DetailViewController alloc] init]; detailViewController.title = @"Detail"; UINavigationController *detaillNC = [[UINavigationController alloc] […]

如何从ios中的应用程序文件夹按datesortinguiimages

如何通过从图库中sortingdate修改types来显示图像。 我可以从文件夹中使用数据 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; 另外如何比较uiimage修改date。 提前致谢….

iOS 7:离开模式ViewController后键盘不显示

我有一个HomeViewController有不同的模式segues其他几个UIViewControllers 。 如果我试图在HomeView中的UITextField上显示键盘,一切工作正常。 但是,如果我尝试从任何模式视图控制器返回后显示UITextField上的键盘(使用becomeFirstResponder ),键盘从不显示。 以下是我尝试过的一个设置的示例代码: 在HomeViewController : – (void)viewDidAppear:(BOOL)animated { static BOOL firstTimeComplete = false; if (!firstTimeComplete) { firstTimeComplete = true; } else { UITextField *textField = [[UITextField alloc] init]; [self.view addSubview:textField]; [textField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:3] } } 在ModalViewController : – (IBAction)done:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } 在哪里done:通过触摸内部事件链接到“完成”button。 我已经尝试了几件事情: 转换模式segues推推进解决了这个问题,但我不希望任何子视图中的导航栏 我已经尝试禁用和启用animation时closures模式视图控制器(使用dismissViewControllerAnimated: 在故事板中使用展开segues而不是以编程方式进行 任何人都知道可能会发生什么?