Cocoa 中的可拖动对象

发布于 2024-09-19 12:54:00 字数 228 浏览 6 评论 0原文

我对目标 c 完全陌生,并且想要创建一个非常雄心勃勃的项目。

我需要做的一件事是有一个绘图层,我可以在中间有一个圆圈,并且能够拖动它附近的其他圆圈来附加它们,然后能够移动它们,改变它们的形状围绕初始圆的位置。

我知道这可能听起来很模糊,但这是我能解释的最好方式。

谁能给我一些关于如何实现这一目标的指示,或者给我一个可以学习如何做到这一点的良好参考?

非常感谢您提供的任何帮助。

I am completely new to objective c and have an quite ambitious project I want to create.

One of the things I'll need to do is have a drawing layer, where I can have a circle in the middle, and be able to drag other circles near it to attach them, and then be able to move them around, changing their position around the initial circle.

I know this may sound vague, but its the best way I can explain it.

Could anyone give me some pointers as to how this could be achieved, or a good reference where I could learn how to do it?

Many thanks for any help you can provide.

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

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

发布评论

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

评论(2

坏尐絯℡ 2024-09-26 12:54:00

您应该查看两个协议:NSDraggingDestinationNSDraggingSource

There are two protocols that you should look at: NSDraggingDestination and NSDraggingSource.

难如初 2024-09-26 12:54:00

Objective-C 是一种可用于开发命令行应用程序、iOS 应用程序、Mac 桌面应用程序和其他应用程序的语言。该语言本身不处理图形,这是留给更高层的。如果您想为 iOS 或 Mac 进行开发,这个更高层称为 Cocoa

要开发应用程序,您需要熟悉 Xcode、Cocoa,或许还需要了解一点 石英 2D。转到 Apple 开发者网站 并开始查找那里,文档非常好。代码示例有时有点复杂,但它们可以帮助您入门。

Objective-C is a language that can be used for developing command-line applications, iOS applications, desktop Mac applications and other beasts. The language itself does not handle graphics, that is left to the higher layers. If you want to develop for iOS or Mac, this higher layer is called Cocoa.

To develop your application you’ll need to get familiar with Xcode, Cocoa and maybe a bit of Quartz 2D. Go to the Apple Developer Website and start looking there, the documentation is quite good. The code samples are a bit hairy sometimes, but they will get you started.

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