0

I keep getting random crashes saying:

Received memory warning. (lldb)

Now after a bit of reading I have found that this is probably due to memory management, resources been fully used and none free. I thought in ARC we dont need to free up memory and release things (it wont even let us release) I thought it did it all by itself.

I have seen from some articles & threads that a possible problem is way that you define @properties so some I have:

FirstViewController

@property (strong) FilterViewController *filterViewController;
@property (weak, nonatomic) IBOutlet MKMapView *mapView;
@property(nonatomic, retain) IBOutlet UILabel *sliderValue;

@property(nonatomic, retain) NSString *passedData;

@property int selectedTime;

FilterViewController

@property (nonatomic, retain) IBOutlet UIDatePicker *datePicker;
@property (strong, nonatomic) IBOutlet UILabel *stepperValueLabel;
@property (strong) FirstViewController *firstViewController;
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Josh Boothe
  • 1,413
  • 4
  • 25
  • 40

1 Answers1

2

Your problem is Retain cycle. firstViewController object is retains filterViewController, and filterViewController object is retains firstViewController

@property (strong) FirstViewController *firstViewController; in FilterViewController 
@property (strong) FilterViewController *filterViewController; in FirstViewController
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144