Allocate Object member variable to another double strong pointer
We can use a __strong double point like this in Objective-C.
NSString *__strong * tmp_pointer;
NSString * target = @"first data";
tmp_pointer = target;
*tmp_pointer = @"second data";
NSLog(@"%@", target);
Output : first data
But what about Object variable?
Example : DataObject has a NSString* type variable 'item1'.
DataObject *dataObject = [[DataObject alloc] init];
NSString *__strong * tmp_pointer;
tmp_pointer = &dataObject.item1; <- Address of property expression
requested error occurred.
I tried several expression but everything was failed.
tmp_pointer = &(dataObject.item1);
tmp_pointer = &(NSString *)dataObject.item1;
tmp_pointer = &((NSString *)dataObject.item1);
Does anybody know how can I solve this?
Thanks
No comments:
Post a Comment