导航栏与多个button

我有一个左右button的导航栏,我需要把另一个button旁边的右边button。 有谁知道我可以怎么做呢? 以下是一些帮助的代码: – (id)init { self = [super initWithStyle:UITableViewStyleGrouped]; if (self) { _pinArray = [[NSArray alloc]init]; _pinArray = [Data singleton].annotations; UIBarButtonItem *right = [[UIBarButtonItem alloc]initWithTitle:@"Map" style:UIBarButtonItemStylePlain target:self action:@selector(goToMap:)]; self.navigationItem.rightBarButtonItem = right; UIBarButtonItem *left = [[UIBarButtonItem alloc]initWithTitle:@"Menu" style:UIBarButtonItemStylePlain target:self action:@selector(goToMenu:)]; self.navigationItem.leftBarButtonItem = left; self.navigationItem.title = @"My Homes"; } return self; }

如何取消UIViews基于块的animation?

我目前主要关注以下问题: 我开始一个animation,其中2个对象属性被触发。 代码是: [UIView animateWithDuration:0.3 animations:^{ greyscaleImage.alpha = 1; activityIndicator.alpha = 1; } completion:^(BOOL f){ if(f) { [activityIndicator startAnimating]; } }]; 这工作正常。 我发现唯一的问题是,我有一个0.3秒的变化,崩溃的应用程序时,持有这个activityIndi​​cator和greyscaleImage的视图被释放。 为了使它更清晰,请设想一下ViewController,它的视图通过默认的iOS-mode-View方式呈现。 现在触发该animation,需要2分钟。 在达到那2分钟之前,你会发现animation很无聊,你想消除这种观点。 现在,视图,activityIndi​​cator和greyscaleImage被释放,animationo / c不知道该怎么做。 所以我想知道,在这里做什么+为什么debugging指向 } completion:^(BOOL f){ 而不是例如[activityIndi​​cator … 有没有办法,让用户在2分钟之前解散视图? 最好的祝福

parsing解除locking不会从本地数据存储删除对象

这应该工作。 下面是解决这个问题的很多尝试之一 myTrainingSessions[indexPath.row].unpinInBackgroundWithBlock{ (succ, e) -> Void in if succ == true { // just remove from table view etc self.myTrainingSessions[indexPath.row].deleteEventually() self.myTrainingSessions.removeAtIndex(indexPath.row) self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) // Shows that my object is still in datastore! // object should be UNPINNED – but appers in this result…. var query = PFQuery(className:TrainingSession.parseClassName()) query.whereKey(self.userType(), equalTo: PFUser.currentUser()) query.orderByDescending("createdAt") query.fromLocalDatastore().ignoreACLs() query.findObjectsInBackgroundWithBlock […]

遵循Swift中ViewController中的协议

试图符合Swift UIViewController子类中的UITableViewDataSource和UITableViewDelegate。 class GameList: UIViewController { var aTableView:UITableView = UITableView() override func viewDidLoad() { super.viewDidLoad() aTableView.delegate = self aTableView.dataSource = self self.view.addSubview(aTableView) //errors on both lines for not conforming } } 文档说,你应该遵循以下方面的class :但通常是超类的地方。 另:不起作用。 在超类之后使用逗号分隔列表也不起作用 编辑: 在下面find答案。 class GameList: UIViewController, UITableViewDataSource, UITableViewDelegate { 还必须采用每个协议的所有必需的方法,我最初并没有这样做。

iOS服务器端validation – 收据types

当我尝试在服务器上validation购买时,我从Apple获得2种收据格式。 任何想法有什么不同? 1) content: { status: 0, receipt: { item_id: "662554154", original_purchase_date: "2012-10-12 08:32:12 Etc/GMT", purchase_date_pst: "2012-10-12 01:32:12 America/Los_Angeles", purchase_date: "2012-10-12 08:32:12 Etc/GMT", product_id: "com.example.mygame.tool1", bid: "com.example.mygame", version_external_identifier: "5647854", bvrs: "1.0", quantity: "1", transaction_id: "8844567822225544", app_item_id: "659563252", original_purchase_date_ms: "1350030732000", original_transaction_id: "8844567822225544", purchase_date_ms: "1350030732000", original_purchase_date_pst: "2012-10-12 01:32:12 America/Los_Angeles" } } 2) content: { receipt: { in_app: […]

我的应用程序冻结,但没有出现错误

任何机构知道我必须检查我的应用程序是否冻结? 我的意思是,我可以看到iPad屏幕上的应用程序,但没有button响应。 当我点击button时,我已经尝试debugging代码,但是我还没有看到任何东西。 我正在阅读有关仪器工具; 具体如何使用它们? 有谁能够帮助我? 我只需要解释一下如何使用这些工具。

应用程序必须准备好在iTunes Connect上进行上传,然后才能在Xcode中进行validation或提交

当我尝试推我的应用程序审查我得到: 应用程序必须准备好在iTunes Connect上进行上传,然后才能在Xcode中进行validation或提交。 ready for upload on iTunes Connect是什么意思?

无法从mainBundle播放MP4video文件

所以我试图播放一个简单的介绍animationvideo文件,我已经拖到我的XCode项目,因此应该能够从我的mainBundle播放,对不对? 有了这个代码: NSURL *urlString = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"introvideo" ofType:@"mp4"]]; MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:urlString]; [player play]; 我得到这个错误信息: *由于未捕获的exception“NSInvalidArgumentException”,终止应用程序,原因:'* – [NSURL initFileURLWithPath:]:nilstring参数' 任何帮助将是伟大的!

禁用UITableView(iPhone SDK 3.0)中的滚动

我试图在UITableViewembeddedUITextField编辑UITableView禁用滚动。 这只是为了防止细胞在编辑时滚动出来(也避免了一些相关的细胞“回收”问题)。 在search时我看到有人提出了明显的: tableView.scrollEnabled = NO: 甚至 tableView.userInteractionEnabled = NO; 这不工作虽然(至less对我来说… iPhone SDK 3.0,尝试在模拟器上)我将这些属性设置为NO,我甚至通过日志logging检查属性设置为NO,但UITableView保持正常响应触摸事件。 而且它也很高兴地滚动。 如果networking上有人没有声称这真的有效,我不会那么担心。 我错过了什么吗? 或者是唯一的替代子类UITableView使其超类(UIScrollView)可用的function再次工作?

当通过becomeFirstResponder将焦点分配给UISearchController的UISearchBar时,键盘不会出现

我花了相当多的时间在网上search,并与其他开发人员讨论这个问题无济于事。 在这个SOpost中描述了确切的问题( 关注UISearchBar,但键盘没有出现 ),虽然已经有很多年了。 我最近在IB中使用了弃用的UISearchDisplayController和UISearchBar,并通过iOS8的代码切换到了UISearchController。 然而,我得到的问题是,焦点分配正确(你可以告诉,因为取消button在视图加载后在search栏右侧animation),但键盘不显示。 这是我的代码。 。H @property (nonatomic, strong) UISearchController *searchController; .M – (void)viewDidLoad { [super viewDidLoad]; … [self initializeSearchController]; …. } – (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self.searchController setActive:YES]; [self.searchController.searchBar becomeFirstResponder]; } – (void)initializeSearchController { self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.searchResultsUpdater = self; self.searchController.dimsBackgroundDuringPresentation = NO; self.searchController.delegate = self; self.searchController.searchBar.delegate = self; [self.searchController.searchBar […]