I have a custom class/object that handles gestures and conducts animations for a given view using a CADisplayLink. In its simplest form my class looks something like follows:

```
@interface SomeClass : NSObject

@property (strong) UIView *someView;

@end

```

When I add the following code to my view controller....

```
- (void)viewDidLoad
{
    [super viewDidLoad];

    SomeClass *someClass = [[SomeClass alloc] init];
    someClass.someView = someView;
}

```

... I was anticipating my someClass object would be retained for the life of the view controller, since I am using a strong reference to someView.

However someClass is immediately deallocated.

I am already aware that I can overcome the deallocation simply by adding someClass as a property (or indeed iVar) of the view controller however I would ideally like to avoid this extra work...

so is there anyway I can have my class retained until either the view or view controller its associated with are deallocated?

**EDIT**

UIGestureRecognizer objects are an exmaple of a class that doesn't get deallocated when I associate them with a view...

```
- (void)viewDidLoad
{
    UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] init];
    [someView addGestureRecognizer:gestureRecognizer];
}
// tapGestureRecognizer still lives

```

Presumably this is because the UIView takes owner ship of the UIGestureRecognizer object. Is there anyway to achieve this with my class and a UIView category? I.e....

```
 - (void)viewDidLoad
{
    [super viewDidLoad];

    SomeClass *someClass = [[SomeClass alloc] init];
    [someView addSomeClass:someClass];
}

```