Tapy
Tapy

Reputation: 1054

How to set declare an IBOutlet to a TextView correctly on Mac OS

I'm going to recreate my iPhone app for the mac. There is only one problem I'm having. This may sound stupid to you but I can't figure it out.

When I want to call a method for the UITextView in iOS i just did like this:

IBOutlet UITextView *myTextView;

and

@property (nonatomic, retain) UITextView *myTextView;

But I can't figure out how to do it for a textfield in Mac OS X developing.

Could someone help me with this?

Thanks!

Upvotes: 0

Views: 491

Answers (1)

danyowdee
danyowdee

Reputation: 4698

  1. There is no UIKit on the mac! The functional equivalent (and then some...) of a UITextView in AppKit is NSTextView.
  2. In AppKit, IBOutlets are not retained!

So your interface should become

@interface YourClass : SuperClass {
    // other ivars
    NSTextView *myTextView;
}
@property (nonatomic, assign) IBOutlet NSTextView *myTextView;
// and so forth...

Upvotes: 1

Related Questions