Tag: xcode

MWFeedParser – 带图像的RSS

我有问题,我在我的iOS应用程序中使用MWFeedParser Rss阅读器,它运作良好,但我需要从我的饲料中获取图像。 你能帮我吗? 这是MWFeedParser项目的URL:GitHub

需要帮助在Spritekit iOS游戏中集成插页式广告

我正在使用Xcode和SpriteKit制作游戏,我正在使用admob整合广告,并使所有的代码都能够用于横幅广告,并且能够让插页式广告也能正常工作。 我的问题是告诉游戏何时显示插页式广告。 广告在GameViewController中,但我需要从GameScene.swift调用showAd()方法。我将如何去在GameScene中从GameViewController调用一个函数。 任何帮助表示赞赏,在此先感谢,扎克。

在后台不调用请求块的URLSession.datatask

当应用程序处于后台时, URLSession数据任务块不会调用,并且会随请求而停留在dataTask上。 当我打开应用程序块被调用。 顺便说一句,我使用https请求。 这是我的代码: let request = NSMutableURLRequest(url: URL(string: url as String)!, cachePolicy: .reloadIgnoringCacheData, timeoutInterval:20) request.httpMethod = method as String request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") let session = URLSession.shared let data = params.data(using: String.Encoding.utf8.rawValue) request.httpBody = data session.dataTask(with: request as URLRequest,completionHandler: {(data, response, error) -> Void in if error == nil { do { let result […]

ld:找不到-lGoogleAdMobAds的库

试图将谷歌的移动广告添加到我的应用程序。 我已经跟着每一步,但最后我有一个致命的错误。 这是一张照片 。 有关如何解决它的任何build议? 谢谢。

错误(“'()”与“UInt8”不同)“使用Swift中的写入函数将NSData字节写入NSOutputStream

我试图build立一个基于埃里卡Sadun的方法在Swift中的asynchronous文件下载。 但我需要它来处理更大的文件,所以我find了有关使用NSOutputStream而不是NSData的答案 ,这是有道理的。 但是,我不能得到它的工作。 (NSURLConnection didReceiveData函数中)向NSOutputStream写入函数添加NSData字节时出现此错误: '()' is not identical to 'UInt8'此行上的'()' is not identical to 'UInt8' : bytesWritten = self.downloadStream.write(data.bytes, maxLength: bytesLeftToWrite) 。 data.bytes的types是ConstUnsafePointer<()> ,而.write()函数期望types是ConstUnsafePointer<UInt8> ,所以在这个意义上,错误是非常有意义的。 但是因为我是iOS新手,当然还有Swift编程,所以我无法理解如何解决这个问题。 那么,如何将data.bytes: ConstUnsafePointer<()>为ConstUnsafePointer<UInt8> alt。 使这个工作有其他的方式吗? 我的didReceiveData函数: func connection(connection: NSURLConnection!, didReceiveData data: NSData!) { var bytesLeftToWrite: NSInteger = data.length var bytesWritten: NSInteger = 0 while bytesLeftToWrite > 0 { […]

Swift TableViewCell xib没有约束

我有两个TableView ,当我devise原始的时候,我使用故事板中的原型单元格来devise它,为了使它可重用,我尝试将它拉出到一个.xib并加载它。 当它从cellID.xib加载的时候,它会在运行时丢失所有的约束条件,而且所有的约束都是相互重叠的。 TableViewController let cellIdentifier = "cellID" override func viewDidLoad() { super.viewDidLoad() tableView.register(UINib(nibName: cellIdentifier, bundle: nil), forCellReuseIdentifier: cellIdentifier) tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 300 } Storyboard中的原型单元格(用于工作) 复制粘贴到XIB时的单元格 约束 XIB视图层次结构

在设备上部署和testing应用程序

我如何在iPod touch上运行我的XCode项目? 我是一名开发人员,我的iPod运行iOS 5.0.1,但我无法弄清楚如何做到这一点。

在Swift中使用LSApplicationWorkspace

我已经将MobileCoreServices.framework添加到我的Xcode项目中,并将语句import MobileCoreServices到我的文件顶部。 我有代码行 let test = LSApplicationWorkspace.defaultWorkSpace() 而xcode表示Unresolved Identifier LSApplicationWorkspace 我试图清理和重build项目。 有任何想法吗?

如何在iOS应用程序中播放m3uaudiostream

我正在尝试使用Xcode 4.5.2创buildiOS / iPhone广播应用程序。 我想播放@“http://xx.xxxxxxx.com/8111/radio.m3u”播放,暂停,音量控制,并能够在后台function/多任务处理上播放。 AVFoundation ,我已经添加了AVFoundation , Mediaplayer和AudioToolBox框架。 我添加了play,暂停和滑块对象到xib。 ViewController.h @interface ViewController : UIViewController @property (strong,nonatomic) MPMoviePlayerController *myPlayer; @property (weak, nonatomic) IBOutlet UISlider *myslider; – (IBAction)playButtonPressed; – (IBAction)myslider:(id)sender; @end ViewController.m #import "ViewController.h" #import <MediaPlayer/MediaPlayer.h> @interface ViewController () { UISlider *volumeSlider; } @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; UIBackgroundTaskIdentifier newTaskId […]

将两个iOS应用程序合并为一个

我有两个独立的公司希望将他们的iOS应用程序“连接”在一起形成一个应用程序(以便只需要一个应用程序商店下载)的情况。 这些应用程序完全独立的代码库。 这些公司正在寻找合作伙伴,但他们并不是真的要彼此看到对方的代码。 一定程度的代码摆弄是可以接受的。 有没有什么办法来“包装”代码库或二进制文件,以便应用程序1可以合并到app2中,而不需要app2开发者访问应用程序1代码库? 谢谢