sigabrt错误在swift中以编程方式调用segue

我是iOS开发新手,目前正在尝试在UITableViewController的单元格被选中后以编程方式调用segue。 尽pipe我已经在storyboard中创build了segue并为其指定了一个标识符,但仍然在重写的didSelectRowAtIndexPath方法中的performSegueWithIdentifier方法调用中收到sigabrt错误。 任何帮助将不胜感激。 override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { self.performSegueWithIdentifier("toExerciseInfo", sender: self) }

迅捷的致命错误:数组索引超出范围

我正在做一个待办事项列表的应用程序,但当我尝试从我的列表中删除的东西,Xcode给我一个错误,说:“致命的错误:数组索引超出范围”。 有人能告诉我什么我做错了我的数组,这是造成这种情况发生? import UIKit class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return eventList.count […]

在Swift 2.1中用MapKit添加不同的引脚颜色

我是Swift新手。 我试图在特定引脚上使用不同的颜色引脚或自定义引脚。 我的代码工作。 我有一个紫色的针,但我想在他们之间有所作为。 我该怎么做? 我认为有一些在MapView委托方法中做的事情,但我没有find它。 import UIKit import MapKit class MapsViewController: UIViewController , MKMapViewDelegate{ var shops: NSArray? { didSet{ self.loadMaps() } } @IBOutlet weak var map: MKMapView? override func viewDidLoad() { super.viewDidLoad() loadMaps() self.title = "Carte" self.map!.delegate = self } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. […]

两个不同的视图控制器如何能够相互通信

我有一个标签栏和3个不同的视图控制器的应用程序。 其中一个iManager我通过Interface Builder(storyboard)devise了一个UItableView,并在Inspector – > inspector identity – >中设置了它的视图控制器类,我在那里设置了类字段,因此,当这个视图控制器得到实例化,因为当用户点击标签栏时,通过故事板完成。 注意,我是新的客观的C和iOS编程。 我面临的问题,我也使用远程通知。 因此,当我在AppDelgate类的“didReceiveRemoteNotification”中收到远程通知消息时。 我需要更新UI接口(上面的ViewController),但问题我没有从我的AppDelgate类(或我?)的这个ViewController的引用(指针)。 这个ViewController的问题,也没有以编程的方式实例化,否则我可以保留对它的引用。 我做了一些阅读,我明白我可以通过NSNotification来进行沟通,但是我认为这可能是一个矫枉过正的问题,可能是因为我是新手,而且我没有完全了解iOS开发。 谢谢,

NSPredicate和NSInvalidArgumentException中的SUBQUERY

我在Core Data中设置了以下模型。 Book has a to-many relationship, called toBookOrders, with OrderBook entity. The inverse is called toBook. Book has a BOOL value property called isSync. 我build立了以下NSPredicate 。 NSEntityDescription* entityDescription = [NSEntityDescription entityForName:@"Book" inManagedObjectContext:moc]; NSPredicate* predicate = [NSPredicate predicateWithFormat:@"isSync == 0 AND SUBQUERY(toBookOrders, $x, $x.toBook == SELF)"]; 通过这个谓词,我只需要抓取没有同步的书籍和他们的相关命令。 这是我收到的错误。 终止应用程序由于未捕获exception“NSInvalidArgumentException”,原因:“无法parsing格式string”isSync == 0和子查询(toBookOrders,$ x,$ x.toBook == SELF)“ […]

IOS 5上的Xcode 4.5错误

我安装了通用版本的xcode,当我尝试在IOS 5上安装我的应用时,我开始收到这个错误。 该应用程序在iOS 6上工作正常。有人可以告诉我可能是什么问题? 我包括libobjc.A.dylib库,我也一样。 dyld:懒符号绑定失败:找不到符号:_objc_setProperty_atomic_copy 参考:/var/mobile/Applications/8BCAAF22-5857-427D-9FDA-48D369CF3DD8/FlipBookApp.app/FlipBookApp预计在:/usr/lib/libobjc.A.dylib dyld:找不到符号:_objc_setProperty_atomic_copy引用自:/var/mobile/Applications/8BCAAF22-5857-427D-9FDA-48D369CF3DD8/FlipBookApp.app/FlipBookApp预计位置:/usr/lib/libobjc.A.dylib

尝试在iOS中将图像保存为具有自定义名称的相册

我有一个iOS应用程序,我将图片保存到我的照片文件夹到我的iPad。 但是,我想要做的是将图像存储为一个自定义名称(例如使用图像实际捕获时的date和时间戳),以便将来可以更容易地进行检索。 目前我的代码存储我的图像如下: – (IBAction)imageCapture:(id)sender { UIImage *myImage = [_imageView currentImage]; UIImageWriteToSavedPhotosAlbum(myImage, nil, nil, nil); } 我能够存储我的图像,但是如何在存储图像之前命名图像(例如“082620131100am.png”? 在此先感谢所有回复的人

无法接收remoteControlReceivedWithEvent – 目标c – ios

屏幕locking后,我成功启用了我的应用程序,以便能够在后台播放audio和video。 但是,为了更好的用户体验,我想在locking的屏幕上显示播放和暂停正在运行的媒体的控件。 在线跟随几个博客之后,添加了以下代码: @interface MyControllerClass () <UIGestureRecognizerDelegate, UIApplicationDelegate> – (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; AVURLAsset *avAsset = [AVURLAsset URLAssetWithURL:url options:nil]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:avAsset]; AVAudioSession *session = [AVAudioSession sharedInstance]; [session setCategory:AVAudioSessionCategoryPlayback error:nil]; NSError *activationError = nil; BOOL success = [[AVAudioSession sharedInstance] setActive: YES error: &activationError]; } – (void)viewWillDisappear:(BOOL)animated { [[UIApplication […]

如何请求权限再次访问iphone联系人地址簿?

我要求使用下面的代码访问我的联系人的权限。 ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { } else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) { } else { } 到目前为止一切正常,但是,如果我删除了应用程序,再次debugging应用程序不会再问我的权限。 在此之前,如果我接受或拒绝,我可以在隐私联系人和我的应用程序的名称中看到它是否打开或closures。 我想要应用程序问我的权限popup。 我应该怎么做重新启动设备并重新安装应用程序。 无论如何清除某种caching?

UItabBar更改视图控制器

我有一些改变标签栏控制器的困难。 基本上我有3个控制器的UITabBarController。 第一次当应用程序启动。 我改变一个这样的控制器: NSMutableArray *muteArray = [[NSMutableArray alloc] init]; FirstPage *online; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { online =[[FirstPage alloc] initWithNibName:nil bundle:nil]; }else{ online =[[FirstPage alloc] initWithNibName:nil bundle:nil]; } //adding all controllers of tab bar to array [muteArray addObjectsFromArray:_navigationCotroller.viewControllers]; online.tabBarControllers = [muteArray copy]; //replacing object of login controller to after login controller [muteArray replaceObjectAtIndex:1 withObject:online]; […]