You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
Hi guys!
Thank you for library, but I see couple of problems in it.
First of all, I want to draw your attention to problems that are connected with ownership qualifiers.
I will show you a few of them, but you will get the point.
For example, these properties in OHContact.h:
Default ownership qualifier for object types in ARC is strong
The problem here is that you can set NSMutableString or NSMutableOrderedSet instead and change them in another place; the values will change in this object too.
It will lead to some hard-to-debug problems.
Second problem is connected with copy method. There is an example from OHContact.m:
At this point, you copied both tags & customProperties to newly created object.
There will be no problem, if you don't change them, but it will be a problem, if you try to add some values to them, because copy of mutable object returns immutable copy and you will receive NSSet and NSDictionary accordingly. So, you will receive runtime error when try to add new objects.
The text was updated successfully, but these errors were encountered:
Hi guys!
Thank you for library, but I see couple of problems in it.
First of all, I want to draw your attention to problems that are connected with ownership qualifiers.
I will show you a few of them, but you will get the point.
For example, these properties in
OHContact.h
:Default ownership qualifier for object types in ARC is strong
The problem here is that you can set
NSMutableString
orNSMutableOrderedSet
instead and change them in another place; the values will change in this object too.It will lead to some hard-to-debug problems.
Second problem is connected with
copy
method. There is an example fromOHContact.m
:Again, you defined both properties as strong.
At this point, you copied both tags & customProperties to newly created object.
There will be no problem, if you don't change them, but it will be a problem, if you try to add some values to them, because copy of mutable object returns immutable copy and you will receive
NSSet
andNSDictionary
accordingly. So, you will receive runtime error when try to add new objects.The text was updated successfully, but these errors were encountered: