Sankalp
Sankalp

Reputation: 2824

Using Cocoa instead of the being deprecated Carbon framework

The Carbon framework will soon be deprecated in the near future.

My first question is whether the deprecation is targeted towards a particular release i.e. whether it's incompatible with 64-bit machines?

Also, since it is known to be deprecated, we are working towards removing the Carbon dependencies and using Cocoa framework instead. While removing some, I came across the use of EventRecord struct defined in the Events.h file. What should be the Cocoa equivalent of the above struct i.e. I should be able to loop through the Event records while using cocoa too.

Upvotes: 2

Views: 350

Answers (1)

Wil Shipley
Wil Shipley

Reputation: 9553

Carbon does work with 64-bit machines, but it doesn’t work in a 64-bit mode, it works in 32-bit mode. You definitely want off it.

Cocoa has NSEvents (NSEvent.h), but a lot of what EventRecord appears to cover just isn’t relevant in Cocoa. Like, you don’t have to worry about “this portion of the window was uncovered” events—the system just calls “-drawRect:” on your NSView subclass.

Upvotes: 3

Related Questions