目标C - 有两个版本?

时间:2022-04-18 05:33:25

So Obj C is mainly used by Apple to program Cocoa apps. But I more interested in utilizing the OOP of Obj C, I'm not trying to code Cocoa apps and am not really interested in making GUI apps with it either, I was just wondering are there two versions of Obj C? GNU and Apple? cause I was reading wikipedia, under the section "Forwarding" where objects can forward messages to other objects that can handle the message.

所以Obj C主要由Apple用来编写Cocoa应用程序。但是我更感兴趣的是利用Obj C的OOP,我不是想编写Cocoa应用程序,也不是真的对用它制作GUI应用程序感兴趣,我只是想知道是否有两个版本的Obj C? GNU和Apple?因为我正在阅读*,在“转发”部分下,对象可以将消息转发给可以处理消息的其他对象。

forwarding methods:

- (retval_t)forward:(SEL)sel args:(arglist_t)args; // with GCC
- (id)forward:(SEL)sel args:(marg_list)args; // with NeXT/Apple systems

action methods:

- (retval_t)performv:(SEL)sel args:(arglist_t)args;  // with GCC
- (id)performv:(SEL)sel args:(marg_list)args; // with NeXT/Apple systems

1 个解决方案

#1


1  

Pretty much. Apple and GCC have diverged in their implementation of the Objective-C language, though a lot of code is still source-compatible.

差不多。 Apple和GCC在Objective-C语言的实现方面存在分歧,尽管许多代码仍然是源代码兼容的。

#1


1  

Pretty much. Apple and GCC have diverged in their implementation of the Objective-C language, though a lot of code is still source-compatible.

差不多。 Apple和GCC在Objective-C语言的实现方面存在分歧,尽管许多代码仍然是源代码兼容的。