readwrite and readonly mutually exclusive

vinoth.kumar

How can I go about achieving this

  • Property has to be readwrite for inner implementation in class

  • Property has to be readonly for external interaction to instances of the class

rob mayoff

In Objective-C:

MyObject.h

@interface MyObject : NSObject

@property (nonatomic, readonly, strong) NSString *myProperty;

@end

MyObject.m

// Class extension
@interface MyObject ()

// Redeclare property read-write
@property (nonatomic, readwrite, strong) NSString *myProperty;

@end

@implementation MyObject

...

In Swift:

class MyObject {

    private(set) var myProperty: String

    ...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

iOS readonly and retain are mutually exclusive

From Dev

Is IN and NOT IN mutually Exclusive?

From Dev

Elasticsearch Mutually Exclusive results

From Dev

Mutually exclusive submits

From Dev

setOnTouchListener and setOnItemLongClickListener mutually exclusive?

From Dev

Knapsack with mutually exclusive items

From Dev

Make NSOperations Mutually exclusive

From Dev

Remove mutually exclusive records

From Dev

Are MX and CNAME mutually exclusive?

From Dev

Mutually Exclusive Images

From Dev

Make NSOperations Mutually exclusive

From Dev

Mutually exclusive options in Angular

From Dev

Constructor with mutually exclusive members

From Dev

Dynamic checkboxes mutually exclusive

From Dev

readonly public, readwrite private property

From Dev

Recoding non-mutually exclusive variables into mutually exclusive variables

From Dev

scala Option mutually exclusive values

From Dev

Class invariant for mutually exclusive conditions

From Dev

getopts checking for mutually exclusive arguments

From Dev

Why are my radiobuttons not mutually exclusive?

From Dev

Choosing mutually exclusive pairs efficiently

From Dev

Mutually exclusive write for HDFS file?

From Dev

With argparse are subparsers inherently mutually exclusive?

From Dev

scala Option mutually exclusive values

From Java

Swift readonly external, readwrite internal property

From Dev

Properties in Objective C (readwrite for self and readonly for others)

From Dev

Is it possible to make two Java interfaces mutually exclusive?

From Dev

Qt: mutually exclusive checkable menu items?

From Dev

Are the Anchor and Dock properties mutually exclusive in WinForms?

Related Related

HotTag

Archive