问题标签 [ios8]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1243 浏览

ios - 扩展 UIView 时的 EXC_BAD_INSTRUCTION

我正在尝试为我正在为 iOS8 使用的键盘创建自己的自定义视图类,当我创建一个扩展的新类时,我在加载键盘时UIView崩溃并出现错误。Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP,subcode=0x0)该错误显示在该行上class KeyButton: UIView {,我正在努力进一步调试。我最初试图扩展UIButton,但没有奏效,所以我将其更改为UIView没有进一步的运气。

我知道 Swift/iOS8 会有一些初期问题,但希望这是可以修复的!

编辑

完整类代码:

0 投票
1 回答
3756 浏览

swift - JSON 结果 (NSArray): valueForKey 没有按预期工作

由于 Web 服务 (JSON) 请求,我有一个 NSArray。

如果我打印NSLog("%@", jsonResult)Array 它会正确显示:

但是,如果我尝试使用以下函数访问 NSArray 中每个条目的键“文本”的值,我总是会得到如下输出:

所以我认为类型不匹配,但我不知道如何找出问题所在。在 Objective-C 中它工作得很好。

任何想法出了什么问题?

更新 1

我发现,如果我只使用 NSObject 而不是 NSString 它会显示正确的文本

但无论如何,我必须将该 NSObject 对象转换为 NSString 或 String,以显示...

它期望显示字符串的编码是什么......或者如何转换这个 NSObject ????

0 投票
1 回答
1610 浏览

ios - UITableViewHeaderFooterView 上的 textLabel 在 iOS8 中不再可访问?

上面的代码在iOS6iOS7上运行良好,并且已经投入生产了一段时间。但是,在iPhone5S 模拟器上的iOS8上运行时,应用程序崩溃并出现以下错误:

-[UIView textLabel]:无法识别的选择器发送到实例 0xeccad20

这是为这个标签设置样式的一种已弃用的方法,还是 iOS8 中的一个错误?

0 投票
21 回答
58745 浏览

ios8 - Xcode 6 错误:“嵌入式二进制文件的包标识符未以父应用程序的包标识符为前缀。”

我正在尝试构建一个扩展项目,而 Xcode 不断在主题中抛出错误。

Xcode 日志错误

不用说,扩展的 bundle id以 app 的 bundle id为前缀。

产品名称:ro.chitza.TodayPics.$(TARGET_NAME:rfc1034identifier

扩展包 ID

我试过清理构建文件夹并重建,没有运气。有趣的是整个项目构建了几次,但在一些代码和 UI 更改之后它开始失败。即使我创建新项目,大约 5-6 次构建后也会发生同样的事情。

有没有其他人遇到这个错误?有关解决方案或解决方法的任何提示?

0 投票
16 回答
38170 浏览

ios - 使用 swift 记录方法签名

我正在尝试重写我的日志记录类,我想知道如何在 swift 文件中替换PRETTY_FUNCTION或 NSStringFromSelector(_cmd) 以跟踪方法调用?

0 投票
1 回答
10831 浏览

objective-c - 在 iOS8 上获取 Push-Notification 列表

是否可以在 iOS 8 上获取所有收到的推送通知的文本?

有没有人在 Apple 提供的文档中找到一些东西?

我知道可以使用蓝牙设备获取通知列表,但我想在本地获取。

0 投票
2 回答
3067 浏览

ios-simulator - iOS 8:使用可调整大小的 iPhone 和 iPad 模拟器

  1. 我在哪里可以获得 iOS 8 可调整大小的 iPhone 和 iPad 模拟器的工作文档?
  2. 如何处理 View Controller 相当大的参数?
  3. 视图控制器如何响应大小变化?

请问有什么指点吗?

0 投票
4 回答
63074 浏览

ios - Swift Error: Variable used within its own initial value

When I'm initializing an instance of an entity I'm getting the error Variable used within its own initial value.

Here is the code throwing the error:

The error points at the word variable.

Here is the WordDefinition class:

What does this error mean ?

0 投票
5 回答
43803 浏览

cllocationmanager - Implement CLLocationManagerDelegate methods in Swift

I've been trying to get this to work for awhile now, and I've come here to ask- how do I go about with using the CLLocationManagerDelegate methods in Swift? I've put this at the top of my class:

I've put the following into my viewDidLoad method:

And I've tried using these delegate methods with no avail:

I've also tried using @optional in front of the functions, but Xcode then throws a compiler error. Any ideas?

0 投票
1 回答
2475 浏览

objective-c - setHTTPBody in iOS 8 + Swift

I am working on converting a custom Objective-C Networking manager that I wrote for a client into Swift, as a way to learn the language and familiarize myself with the docs.

However, when I open up the apple docs regarding setHTTPBody, it says it is no longer supported past 7.1?

In Swift, I have

I would assume a function along the lines of

However - this does not seem to be the case... am I missing something? Or is there a new function to take the place of this deprecated one?