text: Q:
  
  I wonder about releasing variables
  
  UIView *view; //1
  
  UISegmentedControl *scopeBar; //2
  
  NSMutableArray *array; //3
  
  @property (nonatomic, retain) IBOutlet UIView *view;
  
  @property (nonatomic, retain) UISegmentedControl *scopeBar;
  
  @property (nonatomic, retain) NSMutableArray *array;
  
  .m
  
  @synthesize view, scopeBar, array;
  
      for (id subView in [view subviews]) {
          if ([subView isMemberOfClass:[UISegmentedControl class]]) {
              scopeBar = (UISegmentedControl *)subView;
          }
      }
  
  array = [[NSMutableArray alloc] init];
  
  - (void)dealloc {
  }
  
  I think that only the third of the variables has to be released in the dealloc method.
  Is that right?
  
  A:
  
  Yes, (array needs to be released) because you alloc it. So, it's programmer's responsibility to release it.  So -
  - (void)dealloc {
  
      [ array release ] ;
      // Any other resources alloc, init, new should be released
  }
  
  For more info on what to release, Memory management - ObjectiveC
  
  