Tag: ios

在safari ios中打开保存在应用程序中的.mobileconfig文件

我试图在safari中打开一个移动configuration文件(mobileconfig)来安装它,但没有任何工作。 我使用URL Scheme: NSURL *finalURL = [NSURL URLWithString:[NSString stringWithFormat:@"myAppURLScheme://%@",fileName]]; BOOL canOpen = [[UIApplication sharedApplication] openURL:finalURL]; if (canOpen) NSLog(@"can open"); else NSLog(@"can't open"); 日志 – > can open 我试图设置所有的path(该文件是在Documents夹中)文件,而不是文件名,什么都没有。 我该怎么做。 ? 编辑1 :这个应用程序执行相同的操作(打开Safari浏览器来安assembly置) 编辑2 :我认为我必须search的方式发送文件(任何)Safari浏览器,Safari会知道如何处理它。

UISegmentedControl中的两行文本

尝试我可能,我无法解决iOS7 iPhone应用程序的UISegmentedControl错误。 当我创build分段控件时,我使用下面的代码: NSArray *segmentedControlItemArray = [NSArray arrayWithObjects: @"Nominal:\n27 inch", @"Actual:\n700c x 23mm", @"Actual:\n700c x 20mm", nil]; _wheelDiameterSegmentedControl = [[UISegmentedControl alloc] initWithItems:segmentedControlItemArray]; _wheelDiameterSegmentedControl.frame = CGRectMake(0, 102, 290, 50); _wheelDiameterSegmentedControl.selectedSegmentIndex = 0; _wheelDiameterSegmentedControl.tintColor = [UIColor colorWithRed:0.35 green:0.4 blue:0.9 alpha:1.0]; for (id segment in [_wheelDiameterSegmentedControl subviews]) { for (id label in [segment subviews]) { if ([label isKindOfClass:[UILabel […]

如何将场景背景的内容设置为立方体贴图

我试图设置一个场景的背景内容使用大约6个图像的天空盒效果。 我以正确的顺序创build了图像数组,我知道我需要使用 + (instancetype) materialPropertyWithContents:(id)contents 不过,我正在努力解决如何以及在哪里使用该类方法返回包含立方体贴图的属性。

从代码打开地图应用程序 – 在哪里/如何find“当前位置”?

我正在打开地图应用程序,以显示从用户的当前位置到目标坐标的方向,从我的代码。 我正在使用下面的代码来打开地图应用程序。 我按下button时调用此代码。 getCurrentLocation是返回最近更新的位置的方法。 – (void)showDirectionsToHere { CLLocationCoordinate2D currentLocation = [self getCurrentLocation]; // LINE 1 NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f", currentLocation.latitude, currentLocation.longitude, destCoordinate.latitude, destCoordinate.longitude]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } 这里LINE 1中的 [self getCurrentLocation]使用CLLocationManager来确定当前位置并返回值。 注意 :我还没有在LINE1中实现代码。 我刚刚计划这样做。 我的问题是: 这是在地图应用程序被调用时计算当前位置的好习惯吗? 在openURL被调用之前, [self getCurrentLocation ]会返回当前位置? 在打开地图应用程序之前,我必须确定当前位置吗? 我对这些事情有点困惑。 请引导我。 谢谢。

我可以使用JavaScript来获取iOS和Android的指南针标题吗?

我能否以跨平台的方式使用JavaScript来获取iOS和Android(使用Chrome)的指南针标题,而不使用PhoneGap之类的东西? 我知道iOS有DeviceOrientationEvent ,但我无法在Android版Chrome上find任何对等设备。

试图理解Swift中的协议/委托

我是编程和Swift的新手,我正试图理解如何在两个视图控制器(无segue)与协议和委托之间传递数据。 我有一个视图控制器(视图A),它有一个文本字段和button。 当用户点击该button时,它应该显示在另一个视图控制器(视图B)的​​标签中的文本。 我无法获得标签来显示文本 – 我将不胜感激解释什么是需要做这项工作。 非常感谢! import UIKit protocol sendNameToViewB { func showNameLabel(name:String) } class ViewA: UIViewController { var delegate: sendNameToViewB? @IBOutlet weak var textField: UITextField! @IBAction func addButton(sender: AnyObject) { delegate?.showNameLabel(textField.text) } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func […]

如何使用NSURLSession从块获取数据?

我有这个块的问题。 我试图获取NSURLSession块内的数据。 这是我的代码 -(NSDictionary *) RetrieveData{ NSURLSession * session = [NSURLSession sharedSession]; NSURL * url = [NSURL URLWithString: self.getURL]; dataList =[[NSDictionary alloc] init]; NSURLSessionDataTask * dataTask = [session dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { self.json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; }]; return self.dataList; [dataTask resume]; } 是否有可能获得NSURLSession块内的数据?

iOS应用程序中的Google Places API

在提出这个问题之前,让我分享我的发现。 Google Places API文档说:“注意:要使用Google Places API,您必须首先请求您必须使用的Maps API客户端ID和encryption密钥来签署请求URL。有关签署URL请求的信息,请参阅URL身份validation文档在Web服务API主页内“。 Google Places API仍在开发者预览版中。 http://code.google.com/apis/maps/documentation/places/ 我们需要一个客户端ID(必填)和一个签名(必填)来使用Google Places API。 http://code.google.com/apis/maps/documentation/webservices/index.html#URLSigning 而且,要获得Signature,我们需要一个Google Adsense帐户来获取Adsense发布商ID(必填)。 http://gmaps-ws-console.appspot.com/ 您可以在这里find使用Google Places API的要求。 http://code.google.com/apis/maps/documentation/places/index.html#Requirements Google Maps API的注册页面build议您:“您的服务必须可供最终用户免费使用。要在其他types的应用程序中使用Google地图技术,请使用Google Maps API Premier。有关详细信息,请参阅此常见问题解答。 http://code.google.com/intl/it-IT/apis/maps/signup.html 现在,这是我想知道的。 我正计划在iOS应用程序中使用Google Places API。 我不想使用AdSense。 我还可以免费访问Google Places API吗? 怎么样? 如果我无法免费访问Google Places API,那么使用此服务的相关费用以及可用的付款方式是什么? 我无法find这个信息的任何特定的资源。 这是一个特定的场景。 如果我的iOS应用程序是免费的呢? 免费版本使用Google Places API。 但是…我的iOS应用程序有一些额外的function,使用应用内购买(付费function)暴露。 付费function不使用Google Places API。 这可以接受吗?

只将Cocos2D添加到已经存在的项目中?

我已经完成了90%的项目,我只想添加Cocos2D。 我不需要Box2D或花栗鼠。 我将如何做到这一点? 我要添加什么文件? 我真的需要这样做,所以最终如果需要的话提供一个赏金。 谢谢!

应用程序被拒绝,以跟踪用户不更新订阅

我在“在线”杂志上开发了一个应用程序,用于不更新订阅types。 苹果开发者指南说: “使用UDID或Apple Store ID来跟踪订阅是不合适的, 订阅应该使用外部服务器进行跟踪 ,您应该提供这个外部服务器来提供订阅多个设备的function,另外,请记住它并不合适强制用户注册,以满足这一要求;这种用户注册必须是可选的。“ 而我最近因为这些原因而拒绝了我的应用程序: 11.6: Content subscriptions using IAP must last a minimum of 7 days and be available to the user from all of their iOS devices 17.2: Apps that require users to share personal information, such as email address and date of birth, in order to function will be […]