Objective-C 有意见吗?

发布于 2024-12-18 21:29:24 字数 449 浏览 0 评论 0原文

我最近建议的编辑被拒绝让我对我自以为了解的 Objective-C 知识产生了怀疑。

我一直假设 UIViews 是 iOS 的一部分,iOS 是 Objective-C 的后代,并且 Objective-C 没有带有任何视图的默认工具包。

我尝试过一些 Google 和 Stack Overflow 搜索,但结果似乎不值得信赖,而且主要是关于 UIViews 的。 维基百科似乎对此只字未提

Objective-C 有意见吗?或者,正如我之前所假设的那样,这是一个常见的误解吗?

The rejection of a recent edit I suggested gave me doubts about something I thought I knew on Objective-C.

I've lived under the assumption that the UIViews are part of iOS, that iOS is a descendant of Objective-C and that Objective-C has no default kits with any views.

I've tried some Google and Stack Overflow searches, but the results didn't seem trustworthy and were mostly about UIViews. Wikipedia seems to mention nothing about this .

Does Objective-C have views? Or is that, as I assumed before, a common misunderstanding?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

悲歌长辞 2024-12-25 21:29:24

我看到的问题是 iOS 不是 Objective C 的后代。iOS

是操作系统(如 Windows Linux OSX),而 Objective-C 是一种编程语言,尽管大多数 iOS 和 OSX 应用程序都是用它编写的。用 Python 和其他语言编写的 iOS 应用程序,

iOS 本身没有视图 - 这些是 Cocoa-touch 框架的一部分,Cocoa-touch 框架是一组在 iOS 上运行的库,可以使用 Objective C 代码调用。虽然在实践中,对于程序员来说,如果您只为 iOS 设备编写代码,那么 iOS 和 Cocoa touch 中调用代码之间的区别并不是很清楚,但在 OSX 中,这种区别更明显,您可以只使用 OSX 调用编写代码,也可以使用 Cocoa 框架。

如前所述,这些视图是 Cocoa touch 框架的一部分。这可以由包括 Objective-C 在内的任何语言调用。大多数语言不具备编写 GUIS 作为其自身一部分的能力,它们通常使用单独的库来完成此操作。例如,Objective C 本身没有 GUI 库,但有为 iOS 编写的 Cocoa touch,为 OSX 编写的 Cocoa 和 Carbon(尽管主要使用 C 绑定),为 Windows 和类 Unix 操作系统编写的 GNUStep(以及历史上的 NeXTStep、OpenStep、Rhapsody,基本上)早期版本的 Cocoa,在各种操作系统和 Stepstone 的 ICPak 201 上)

The problem that I see is that iOS is NOT a descendant of Objective C.

iOS is the operating system (like Windows Linux OSX) whilst Objective-C is a programming language albeit one that most iOS and OSX apps are written in. However there are iOS apps written in Python and other languages,

iOS as such does not have views - these are part of the Cocoa-touch framework which is a set of libraries that run on iOS and can be called with Objective C code. Although in practice for the programmer the difference between calling code in iOS and Cocoa touch is not really clear if you are only writing for iOS devices, the split is clearer in OSX where you can write code just using OSX calls or can use Cocoa frameworks.

As noted the views are part of the Cocoa touch framework. This can be called by any language including Objective - C. Most languages do not include the ability to write GUIS as part of itself they usually make use of separate libraries to do this. For example Objective C has no GUI libraries itself but has had Cocoa touch written for iOS, Cocoa and Carbon (although that mainly uses a C binding) for OSX and GNUStep for Windows and Unix like OSes (and historically NeXTStep, OpenStep, Rhapsody, basically earlier versions of Cocoa, on various OSs and Stepstone's ICPak 201)

£噩梦荏苒 2024-12-25 21:29:24

Objective-C 是开源编程语言。 UIKit(iOS) 和 AppKit(Mac OS) 提供了视觉元素 - 这不是开源的。

Objective-C 本身没有 UI,这是由其他框架提供的。

Objective-C is the open source programming language. UIKit(iOS) and AppKit(Mac OS) are what provide the visual elements - and this is not open source.

Objective-C itself doesn't have a UI, that's provided by other frameworks.

趴在窗边数星星i 2024-12-25 21:29:24

据我了解,obj-c 的视图是 UIKit 框架的一部分: 查看此处

它是为在 iOS 上构建 GUI 应用程序而设计的。

我不认为你可以在其他 obj-c 应用程序中使用这个框架,但可以在 iOS 上使用。可能还有其他框架具有可以使用的视图。

编辑:是的,@Mark 的观点很好,您将操作系统与编程语言混淆了

From what I have understood obj-c's views are part of the UIKit framework : check here

which is designed for constructing GUI applications on the iOS.

I don't think you can use this framework in other obj-c applications but on iOS. Probably there are other frameworks that have views which can be used.

Edit: And yes, good point by @Mark that you are confusing the Operating System with the Programming Language

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文