小编Tai*_*mal的帖子

Frameworks are 'red' in Xcode

I downloaded a project developed by Apple employees ( who taught course at Stanford on iPhone application development). Strangely , the frameworks are red.

http://img.skitch.com/20100730-kcjun96mp2pxnpg7w3x6njw57.jpg

I tried to locate coreGraphics.framework and UIKit.framework to add them again but i couldnt find them either.

Taimur

iphone xcode iphone-sdk-3.0

31
推荐指数
4
解决办法
4万
查看次数

今天Widget扩展高度 - iOS10

无法为紧凑模式设置今日小部件视图模式的高度.无论我设定什么价值.它将窗口小部件的高度设置为默认值.扩展模式工作正常,值正确设置并反映在窗口小部件中.我已经在viewDidLoad()方法中添加了这一行.

self.extensionContext?.widgetLargestAvailableDisplayMode = .expanded
Run Code Online (Sandbox Code Playgroud)

这是代码.maxSize的值不能像常量那样改变.

func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {

        //self.preferredContentSize = (activeDisplayMode == .compact) ? maxSize : CGSize(width: maxSize.width, height: 300)

        if activeDisplayMode == NCWidgetDisplayMode.compact
        {
             self.preferredContentSize = CGSize(width: maxSize.width, height: 300)
        }
        else
        {
            self.preferredContentSize = CGSize(width: maxSize.width, height: 560)
        }
}
Run Code Online (Sandbox Code Playgroud)

ios swift today-extension ios10-today-widget

20
推荐指数
2
解决办法
8853
查看次数

循环链表算法

我最近在求职面试中被问到开发一种算法,可以确定链表是否是周期性的.由于它是一个链表,我们不知道它的大小.这是一个双向链表,每个节点都有"下一个"和"前一个"指针.节点可以连接到任何其他节点,也可以连接到自身.

我当时提出的唯一解决方案是选择一个节点并与链表的所有节点一起检查.面试官显然不喜欢这个想法,因为它不是最佳解决方案.什么是更好的方法?

c c++ linked-list data-structures

9
推荐指数
2
解决办法
4614
查看次数

iOS Sdk谷歌Chromecast字幕

这就是我使用Google Chromecast设备显示字幕的方法.但副标题并没有出现.我是否必须在Chromecast API中进行更改?

var subtitleName:String = ""
var subtitleLink:String = ""
var subtitleType:String = ""
var subtitleCode:String = ""

if let _ = self.selectedSubtitle
{
  let subtitleIndex: Int = self.selectedSubtitle! - 1
  subtitleName = self.videoObject.subtitles![subtitleIndex].language!
  subtitleLink = self.videoObject.subtitles![subtitleIndex].link!
  subtitleLink = subtitleLink + ".vtt"

  subtitleType = self.videoObject.subtitles![subtitleIndex].type!
  subtitleCode = (self.subtitleLanguages.objectAtIndex(subtitleIndex) as! ICFLanguageObject).iso_639_3! as String

}

print("\n\nName: \(subtitleName),\n Link:\(subtitleLink) \n Type: \(subtitleType)\n Code: \(subtitleCode)\n\n")
//Values Printed on console

//Name: ara,

//Link:http://a**************c.vtt

//Type: subtitles

//Code: ara



    let subtitlesTrack = GCKMediaTrack(identifier: chromeCast_SubtitleID,
    contentIdentifier:subtitleLink,
    contentType: …
Run Code Online (Sandbox Code Playgroud)

ios google-cast chromecast swift

7
推荐指数
1
解决办法
1151
查看次数

iOS Airplay - "在电视上播放"

我已使用此代码显示了播放按钮

var airplayButton: UIBarButtonItem!
let airView: MPVolumeView = MPVolumeView()
airView.showsRouteButton = true
airView.showsVolumeSlider = false
airView.sizeToFit()
airView.tintColor = UIColor.blackColor()

airplayButton = UIBarButtonItem(customView: airView)
airplayButton.tintColor = UIColor.whiteColor()
Run Code Online (Sandbox Code Playgroud)

现在,我想要显示一个屏幕.iOS Airplay框架中是否有任何默认方法可以显示它.或者我必须自己设计屏幕.此外,没有代表可以验证设备何时连接,并且电影通过iOS设备在AppleTV上开始流式传输.我只有一个变量来检查即externalPlaybackActive

问题是如果我使用变量它将不是有效的解决方案,因为我可以在播放期间从Control连接airplay.如果电影在AppleTV上播放,我不想在每秒后运行计时器来检查.有更好的想法吗?

这个视频正在"Apple TV"上播放

像这样 图片

ios avplayer airplay apple-tv avplayerviewcontroller

6
推荐指数
1
解决办法
2468
查看次数

iOS 附近设备的蓝牙 mac 地址

我想使用蓝牙获取附近设备的 MAC 地址 这就是我想要获取的格式。

FE:4F:AD:37:67:5D

我在委托中有完全不同格式的 mac 地址

5962C58F-BAD1-65D4-DCAC-06BBB06307C6

这些是我正在使用的代表

CBCentralManagerDelegate

funccentralManager(_central:CBCentralManager,didDiscover外围设备:CBPeripheral,advertisementData:[字符串:Any],rssi RSSI:NSNumber)

这是我的代码

  func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
            if(!peripherals.contains(peripheral)) {
                peripherals.append(peripheral)
            }
            
            let identifier = "\(peripheral.identifier)"
            if let data = identifier.data(using: .utf8) {
                let mac_address = data.hexEncodedString().uppercased()
                let macAddress = mac_address.separate(every: 2, with: ":")
                if let name = peripheral.name {
                    print("\(name) \n\(peripheral.identifier)\nMAC_ADDRESS: \(macAddress)")
                }
                
            }
        }
        
        
        func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
            mainPeripheral = nil …
Run Code Online (Sandbox Code Playgroud)

xcode mac-address core-bluetooth swift

6
推荐指数
1
解决办法
7334
查看次数

更改UIButton上的文本大小

客户希望我做点什么,我刚检查过,我很确定它不可能.他要求在按钮(UIButton)上放置一个文本.(默认状态配置)当用户单击它时,文本应该放大.(Highligted State Configuration)我通过选择Highligted State Configuration进行检查,然后在Interface Builder中更改了文本的大小,但我没有工作.默认状态配置的文本也已更改.如果有办法,请告诉我.

谢谢!

泰穆尔

iphone interface-builder uibutton ios-simulator

5
推荐指数
2
解决办法
1万
查看次数

差异类和实例方法

什么是类方法和实例方法之间的区别.为什么我们需要单独使用它们?有人可以解释一下吗?

类和实例方法

•实例响应实例方法

 - (id)init;
 - (float)height;
 - (void)walk;
Run Code Online (Sandbox Code Playgroud)

•类响应类方法

 + (id)alloc;
 + (id)person;
 + (Person *)sharedPerson;
Run Code Online (Sandbox Code Playgroud)

泰穆尔

methods conventions objective-c

5
推荐指数
2
解决办法
3785
查看次数

Calendar API - iOS7

iPad有日历API吗?请参考图片.这是iOS7中的日历应用程序

日历iPad

iphone nscalendar fullcalendar ios ios7

5
推荐指数
1
解决办法
1万
查看次数

如果让 - 多个条件

我可以在 IF 中使用 let obj = Something 的多个条件吗

if let u = custom["u"] as? String || let url = custom["URL"] as? String
{
// Do something here
}
Run Code Online (Sandbox Code Playgroud)

ios swift swift2 option-type

5
推荐指数
1
解决办法
1667
查看次数