iPhone / iPad上下文菜单

我在谈论当你select一个文本块时出现的菜单,它给你select剪切/粘贴/复制。 我想出了如何在菜单中添加一个选项,但如果我添加两个或更多的选项,它会首先说“更多”。 点击它会显示我添加的所有选项。 但有没有办法显示所有的选项,我join了前? 没有“更多”菜单项?

删除MKMapView注释与一定的pinColor?

是否有可能删除给定pinColor给定MKMapView上的所有注释? 我试图清除我的地图上的所有用户input的注释(引脚)之前显示新的我的应用程序的一部分,但我不知道如何粒度我可以有select地删除注释… 我想只删除所有具有MKPinAnnotationColorGreen(绿色)引脚的注释,但是我也可以简单地删除用户input的所有引脚,如果有方法我可以跟踪这些。 我知道我可以简单地做: [myMapView removeAnnotations:myMapView.annotations]; …然后重新绘制所有我想要的注释,但这似乎是浪费资源。 有什么build议?

优步无效的OAuth 2.0凭据提供Uber身份validation在iOS Swift中

我在我的iOS(Swift)应用程序中实现Uber的Request Endpoint 。 Request API / Endpoint需要使用应用程序的用户身份validation,这里是文档 。 为此,我使用这个Oauth2.0库 我做的是 在给定的安装说明的帮助下,成功地将库集成到我的项目(xCode)中。 在我的AppDelegate let uber_OAuth_Settings = [ "client_id": "XXXXXXX9vtKzobvXXXXXX", "client_secret": "EXXXXXXXXyFUNCa_Wez6AXXXXXXXnrXtxus", "authorize_uri": "https://login.uber.com/oauth/authorize", "token_uri": "https://login.uber.com/oauth/token", "redirect_uris": ["jamesappv2://oauth/callback"], // don't forget to register this scheme ] as OAuth2JSON var oauth:OAuth2CodeGrant! 在我的方法didFinishLaunchingWithOptions的Appdelegate oauth = OAuth2CodeGrant(settings: uber_OAuth_Settings) oauth.viewTitle = "Uber Login Service" // optional oauth.verbose = true // For […]

获取iPod库中的项目的相册年份?

尝试下面的代码: // Per albums MPMediaQuery *albumsQuery = [MPMediaQuery albumsQuery]; NSArray *collections = [albumsQuery collections]; for (MPMediaItemCollection *collection in collections) { NSDate *collectionReleaseDate = [collection valueForProperty: MPMediaItemPropertyReleaseDate]; NSLog(@"collection release date: %@", collectionReleaseDate); MPMediaItem *representativeItem = [collection representativeItem]; NSDate *representativeItemReleaseDate = [representativeItem valueForProperty: MPMediaItemPropertyReleaseDate]; NSLog(@"representativeItem release date: %@", representativeItemReleaseDate); } // Just per item MPMediaQuery *query = […]

AVAudioPlayer – 按顺序播放多个audio文件

我想用AVAudioPlayer按顺序播放多个MP3文件。 我试了一下,然后在播放第一首MP3后停下来。 但是,如果我进入debugging器,它工作正常..任何想法? 我在某处读AVAudioPlayer在后台播放audio..我如何防止它做到这一点? 沃什

核心数据:从多个实体或关系获取结果

我有两个实体。 Employee实体 @interface Employee : NSManagedObject @property (nonatomic, retain) NSString * dept; @property (nonatomic, retain) NSString * email; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) Department *deptEmp; @end 和Department实体 @interface Department : NSManagedObject @property (nonatomic, retain) NSString * location; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) Employee *deptEmp1; 我试图从下面的谓词中获取信息 NSMutableString *queryString […]

在SKScene上呈现一个viewController

我想在SkView上呈现UIActivityViewController ,但xcode给了我这个错误: 'GameOver'没有可见的@interface声明select器'presentViewController:animated:completion:' – (void)shareScore { //add view UIView *Sview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 512, 512)]; UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shareScoreImg.png"]]; image.frame = Sview.frame; [Sview addSubview:image]; //add label CGRect fframe = self.view.frame; UILabel *score = [[UILabel alloc] initWithFrame:fframe]; score.text = @"9999"; score.textAlignment = NSTextAlignmentCenter; score.textColor = [UIColor darkGrayColor]; score.center = CGPointMake(250, 440); score.font = […]

从UIAlertView文本字段获取文本的问题

在我的应用程序,我想要一个文本框的警报。 点击“完成”后,我想将文本字段保存在一个string中。 点击“取消”后,我只想closures警报。 我已经创build了这样的警报: var alert = UIAlertView() alert.title = "Enter Input" alert.addButtonWithTitle("Done") alert.alertViewStyle = UIAlertViewStyle.PlainTextInput alert.addButtonWithTitle("Cancel") alert.show() let textField = alert.textFieldAtIndex(0) textField!.placeholder = "Enter an Item" println(textField!.text) 警报看起来像这样: 我想知道如何从文本框中获取文本,以及如何为“完成”button和“取消”button创build事件。

我怎样才能在Xcode框架debugging?

我有两个项目,一个是networkLiblogin和一些其他的networkingfunction,另一个是usingLibDemo 。 所以我有这两个项目的所有源代码。 myNetKit.framework项目输出一个名为myNetKit.framework的框架,该框架由使用usingLibDemo 。 现在我成功地使用myNetKit.framework来login,但有时它崩溃,也许在main()没有堆栈信息,但有时Xcode给了我像下面的堆栈信息: 所以我知道它崩溃的地方: 但是Utils.m没有公开, Xcode如何获取堆栈信息和崩溃行,并最终为我打开源文件? 因为我有我的磁盘的源代码? 如果是这样,我怎么能一步一步debuggingmyNetKit.framework ,当它不崩溃? 非常感谢任何提示。

问题pushViewController从风景到肖像

我试图从支持横向(而在横向模式)的视图控制器,到明确不支持(而不应该)横向的视图控制器。 我这样做如下: – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return (toInterfaceOrientation == UIInterfaceOrientationPortrait); } 理想情况下,我想要新的viewController,我推到堆栈上开始在肖像,而不是风景。 奇怪的是,即使这个方法实施,它开始景观。 我唯一的猜测是,苹果公司不希望用户从风景转换到肖像(尽pipe允许我们从风景转移到前面的肖像控制器)。 任何见解和/或帮助将不胜感激。