Memory leak on `initWithNibName` - ios

I'm having an issue with a memory leak. In Instruments, I'm getting a memory leak on this line:
VDLPlaybackViewController *videoController = [[VDLPlaybackViewController alloc] initWithNibName:#"VDLPlaybackView" bundle:nil];
I'm not sure what could be the issue on this. Here is the header file for VDLPlaybackViewController.h:
#protocol VDLPlaybackViewControllerDelegate <NSObject>
#required
-(void)playerShouldClose;
#end
#interface VDLPlaybackViewController : UIViewController <UIDocumentInteractionControllerDelegate>
#property (nonatomic, strong) id<VDLPlaybackViewControllerDelegate> delegate;
// content file stuff.
#property (nonatomic, strong) File *file;
#property (nonatomic, strong) NSNumber *contentID;
#property (nonatomic, strong) NSURL *fileURL;
#property (nonatomic, strong) NSString *pageTitle;
// layout stuff
#property (strong, nonatomic) IBOutlet NSLayoutConstraint *topTimeViewHeight;
#property (strong, nonatomic) IBOutlet NSLayoutConstraint *bottomControlViewHeight;
#property (nonatomic, strong) IBOutlet UIView *movieView;
#property (nonatomic, strong) IBOutlet UIView *navBarView;
#property (nonatomic, strong) IBOutlet UISlider *positionSlider;
#property (nonatomic, strong) IBOutlet UIButton *timeDisplay;
#property (nonatomic, strong) IBOutlet UIButton *playPauseButton;
#property (nonatomic, strong) IBOutlet UIButton *subtitleSwitcherButton;
#property (nonatomic, strong) IBOutlet UIButton *audioSwitcherButton;
#property (nonatomic, strong) IBOutlet UIButton *screenSizeSwitcherButton;
//#property (nonatomic, strong) IBOutlet UINavigationBar *toolbar;
#property (nonatomic, strong) IBOutlet UIView *controllerPanel;
#property (nonatomic, strong) IBOutlet UISlider *volumeSlider;
#property (nonatomic, strong) IBOutlet MPVolumeView *volumeView;
#property (nonatomic, strong) IBOutlet MPVolumeView *airplayView;
#property (nonatomic, assign) CGRect shareButtonFrame;
#property (nonatomic, strong) MultiFileShareButtonController *shareButtonController;
#property (nonatomic, strong) FavoriteFileButtonView *favoriteButtonController;
#property (nonatomic, strong) UIDocumentInteractionController *interactionController;
#property (nonatomic, assign) BOOL isDestroying;
- (void)setMediaURL:(NSURL*)theURL;
- (IBAction)closePlayback:(id)sender;
- (IBAction)positionSliderDrag:(id)sender;
- (IBAction)positionSliderAction:(id)sender;
- (IBAction)toggleTimeDisplay:(id)sender;
- (IBAction)playandPause:(id)sender;
//- (IBAction)switchAudioTrack:(id)sender;
//- (IBAction)switchSubtitleTrack:(id)sender;
- (IBAction)switchVideoDimensions:(id)sender;
#end
Does anyone know what causes this?

The instrumentation tool tells you that there is a leak on the following line:
VDLPlaybackViewController *videoController = [[VDLPlaybackViewController alloc] initWithNibName:#"VDLPlaybackView" bundle:nil];
It does not mean, that it's just this line which is causing the leak, the tool is telling you that a reference of this variable exists as a leak.
You should look for instances where a strong reference to VDLPlaybackViewController *videoController was passed.. may be as delegates or in completion blocks.
The interface which you have in the question has a little problem. It should be weak instead of strong
#property (nonatomic, weak) id<VDLPlaybackViewControllerDelegate> delegate;
Find more instances like this, where you've passed around VDLPlaybackViewController as a strong reference delegate and you would be able to resolve the problem.
To understand more on why the leak is actually happening. Go through
https://cocoacasts.com/what-are-strong-reference-cycles

Related

pointer to non-const type 'id' with no explicit ownership xcode

I have an app that runs great on various devices but when I try to run it on the simulator I get the following error.
pointer to non-const type 'id' with no explicit ownership
I see where I should remove the * from the id* to solve the problem, however the id* resides inside the coreData.h so I can't change it.
How can I get rid of this error?
in the NSFetchRequest.h there is a line
id*_additionalPrivateIvars; (this is where the error is coming from)
it is a header inside the framework coreDate/coreData.h
this framework is imported into one of my view controllers
others within coreData are
id** _kvcpropertyAccessors; in NSEntityDescription.h
and
id_optimizationHints; in NSManagedObjectModel.h
and
id_cachedObsInfoByEntity; and id*_contextLabel; in NSManagedObject.h
and
id _additonalPrivateIvars; inside NSPersistentStoreCoordinator.h
and
id _oidFactories; in NSPersistentStore.h
don't know if this helps but...
all of these have to do with uploading a video to youtube
I don't have all the devices so I have to run the app on the simulator mostly to look at the different view to make sure everything looks right. I can't use autoresize because I have various animation when the views run and they have to position things differently depending on the device.
Any help would be greatly appreciated.
OK here is the code in context within coreData/NSEntityDescription.h
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSRange.h>
NS_ASSUME_NONNULL_BEGIN
#class NSManagedObjectModel;
#class NSManagedObjectContext;
#class NSManagedObject;
#class NSData;
#class NSPropertyDescription;
#class NSRelationshipDescription;
#class NSAttributeDescription;
// Entities describe the "types" of objects available.
NS_CLASS_AVAILABLE(10_4,3_0)
#interface NSEntityDescription : NSObject <NSCoding, NSCopying, NSFastEnumeration> {
#private
int32_t _cd_rc;
id _snapshotClass;
NSString *_versionHashModifier;
NSData *_versionHash;
__weak NSManagedObjectModel *_model;
NSString *_classNameForEntity;
Class _instanceClass;
NSString *_name;
__weak NSEntityDescription *_rootentity;
__weak NSEntityDescription *_superentity;
NSMutableDictionary *_subentities;
NSMutableDictionary *_properties;
id _propertyMapping;
__strong NSRange *_propertyRanges;
struct __entityDescriptionFlags {
unsigned int _isAbstract:1;
unsigned int _shouldValidateOnSave:1;
unsigned int _isImmutable:1;
unsigned int _isFlattened:1;
unsigned int _skipValidation:1;
unsigned int _hasPropertiesIndexedBySpotlight:1;
unsigned int _hasPropertiesStoredInTruthFile:1;
unsigned int _rangesAreInDataBlob:1;
unsigned int _hasAttributesWithExternalDataReferences:1;
unsigned int _hasNonstandardPrimitiveProperties:2;
unsigned int _hasUniqueProperties:1;
unsigned int _validationUniqueProperties:1;
unsigned int _reservedEntityDescription:19;
} _entityDescriptionFlags;
__strong void *_extraIvars;
NSMutableDictionary *_userInfo;
id _flattenedSubentities;
id** _kvcPropertyAccessors; (THIS IS THE OFFENDING CODE LINE)
long _modelsReferenceIDForEntity;
}
and here is the youTubeConnectViewController.h page that imports the coreData.h framework. // youTubeConnectViewController.h
// my little world app
//
// Created by Creatucate on 11/25/12.
// Copyright (c) 2012 Creatucate. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GData.h"
#import "GDataYouTubeAccessControl.h"
#import <GoogleSignIn/GoogleSignIn.h>
#import <CoreData/CoreData.h>
#import <Security/Security.h>
#import "SSKeychain.h"
#define devKey #"AIzaSyDrmQGFblRrH0aBTbR7gsMKxl5QMqgTxcc"
#interface youTubeConnectViewController : UIViewController <UITextViewDelegate, UIPickerViewDataSource,UIPickerViewDelegate, UITextFieldDelegate,NSFetchedResultsControllerDelegate,GIDSignInDelegate,GIDSignInUIDelegate>{
IBOutlet UILabel *UserName;
IBOutlet UILabel *commas;
IBOutlet UIButton *signInButton1;
IBOutlet NSTextField *mEntryCountField;*/
IBOutlet UIPickerView *catagoryPicker;
IBOutlet UIProgressView *mUploadProgressIndicator;
IBOutlet UIButton *cancel;
NSDictionary *titleTextAttributes;
IBOutlet UITextField *number;
IBOutlet UILabel *toptitle;
IBOutlet UILabel *movieTitle;
IBOutlet UILabel *descp;
IBOutlet UILabel *tags;
IBOutlet UILabel *catag;
IBOutlet UILabel *account;
IBOutlet UILabel *pub;
IBOutlet UILabel *pubdef;
IBOutlet UILabel *pub1;
IBOutlet UILabel *unlist;
IBOutlet UILabel *unlistdef;
IBOutlet UILabel *unlist1;
IBOutlet UILabel *priv;
IBOutlet UILabel *privdef;
IBOutlet UILabel *priv1;
NSDictionary *pictureDictionary3;
NSDictionary *pictureDictionary4;
NSMutableArray *pickerArray;
IBOutlet UITextField *catagoryField;
IBOutlet UITextField *catagoryField1;
IBOutlet UITextField *ViewingField;
IBOutlet UIImageView *buttonbg;
IBOutlet UIImageView *pickerback;
IBOutlet UILabel *okl;
IBOutlet UIView *SignInButton;
float downloadingstatus;
IBOutlet UITextView* terms;
NSString *authToken;
BOOL mIsPrivate;
BOOL mIsPublic;
IBOutlet UIImageView *signIn;
IBOutlet UIImageView *fail;
IBOutlet UIImageView *signOutView;
IBOutlet UIButton *signIncancel;
IBOutlet UIButton *ok;
IBOutlet UILabel *Password;
IBOutlet UITextField *UserNameField;
IBOutlet UITextField *PasswordField;
IBOutlet UITextField *movieNameField;
IBOutlet UITextField *tagsField;
IBOutlet UITextView *descpView;
IBOutlet UITextField *accountView;
IBOutlet UITextField *UserOutField;
IBOutlet UITextField *PublicField;
IBOutlet UITextField *PrivateField;
IBOutlet UITextField *UnlistedField;
IBOutlet UIButton *chooseButton;
NSMutableDictionary *SignInDictionary;
IBOutlet UITextField *PasswordDisplayField;
IBOutlet UIButton *termsButton;
IBOutlet UIButton *SignOutButton;
IBOutlet UIButton *cancelOutButton;
IBOutlet UIButton *toOutButton;
IBOutlet UITextField *length;
IBOutlet UILabel *authfailed;
IBOutlet UILabel *YouTubesignin;
IBOutlet UILabel *YouTubesignout;
IBOutlet UILabel *YouTubesignoutacc;
IBOutlet UITextView *errorfailed;
IBOutlet UIScrollView *scrollview;
GDataFeedYouTubeVideo *mEntriesFeed; // user feed of album entries
GDataServiceTicket *mEntriesFetchTicket;
NSError *mEntriesFetchError;
NSString *mEntryImageURLString;
GDataServiceTicket *mUploadTicket;
NSURL *mUploadLocationURL;
UIImage *buttonimage3;
}
#property (nonatomic, retain)IBOutlet UILabel *allow;
#property (nonatomic, retain)IBOutlet UILabel *done;
#property (nonatomic, retain)IBOutlet UILabel *tap1;
#property (nonatomic, retain)IBOutlet UILabel *tap2;
#property (nonatomic, retain)IBOutlet UILabel *tap3;
#property (nonatomic, retain)IBOutlet UILabel *tap4;
#property (nonatomic, retain)IBOutlet UILabel *tap5;
#property (nonatomic, retain)IBOutlet UILabel *tap6;
#property (nonatomic, retain)IBOutlet UILabel *tap7;
#property(retain, nonatomic) IBOutlet GIDSignInButton *signInButton;
#property (nonatomic, retain) UIImage *buttonimage3;
- (GDataServiceGoogleYouTube *)youTubeService;
#property (nonatomic, retain) IBOutlet UILabel *commas;
#property (nonatomic, retain) IBOutlet UITextField *length;
#property (readwrite, retain) UIView *inputAccessoryView;
#property (nonatomic, retain) IBOutlet UITextField *catagoryField;
#property (nonatomic, retain) IBOutlet UITextField *catagoryField1;
#property (nonatomic, retain) IBOutlet UITextField *PasswordDisplayField;
#property (nonatomic, retain) IBOutlet UIProgressView *mUploadProgressIndicator;
#property (nonatomic, retain) IBOutlet UIScrollView *scrollview;
#property (nonatomic, retain) IBOutlet UIImageView *signIn;
#property (nonatomic, retain) IBOutlet UIImageView *signOutView;
#property (nonatomic, retain)IBOutlet UIButton *signIncancel;
#property (nonatomic, retain)IBOutlet UIButton *signInButton1;
#property (nonatomic, retain)IBOutlet UILabel *UserName;
#property (nonatomic, retain)IBOutlet UILabel *Password;
#property (nonatomic, retain)IBOutlet UITextField *UserNameField;
#property (nonatomic, retain)IBOutlet UITextField *PasswordField;
#property (nonatomic, retain)IBOutlet UITextField *movieNameField;
#property (nonatomic, retain)IBOutlet UITextField *tagsField;
#property (nonatomic, retain) NSArray *pickerArray;
#property (nonatomic, retain) IBOutlet UIButton *chooseButton;
#property (nonatomic, retain) IBOutlet UIPickerView *catagoryPicker;
#property (nonatomic, retain) NSMutableDictionary *SignInDictionary;
#property (nonatomic, retain) IBOutlet UITextField *accountView;
#property (nonatomic, retain) IBOutlet UITextField *UserOutField;
#property (nonatomic, retain) IBOutlet UITextField *ViewingField;
#property (nonatomic, retain) IBOutlet UITextField *PublicField;
#property (nonatomic, retain) IBOutlet UITextField *PrivateField;
#property (nonatomic, retain) IBOutlet UITextField *UnlistedField;
#property (nonatomic, retain) IBOutlet UIImageView *buttonbg;
#property (nonatomic, retain) IBOutlet UIImageView *pickerback;
#property (nonatomic, retain) IBOutlet UILabel *okl;
#property (nonatomic, retain) IBOutlet UIImageView *fail;
#property (nonatomic, retain) IBOutlet UIButton *ok;
#property (nonatomic, retain) IBOutlet UITextView* terms;
-(IBAction)failure:(id)sender;
-(IBAction)cancel:(id)sender;
-(IBAction)cancelSignIn:(id)sender;
-(IBAction)hideUserName:(id)sender;
-(IBAction)hidePassword:(id)sender;
-(IBAction)hideTitle:(id)sender;
-(void)textViewDidBeginEditing:(id)sender;
-(IBAction)displayPicker:(id)sender;
-(IBAction)dismissPicker:(id)sender;
-(IBAction)showTerms:(id)sender;
-(IBAction)signOut:(id)sender;
-(IBAction)CancelOut:(id)sender;
-(IBAction)ToOut:(id)sender;
-(IBAction)Public:(id)sender;
-(IBAction)Private:(id)sender;
-(IBAction)Unlisted:(id)sender;
-(IBAction)textFieldReturn:(id)sender;
#property (nonatomic, retain)IBOutlet UIButton *SignOutButton;
#property (nonatomic, retain)IBOutlet UIButton *cancelOutButton;
#property (nonatomic, retain)IBOutlet UIButton *toOutButton;
#property (nonatomic, retain)IBOutlet UIButton *termsButton;
#property (nonatomic, retain)IBOutlet UILabel *toptitle;
#property (nonatomic, retain)IBOutlet UILabel *movieTitle;
#property (nonatomic, retain)IBOutlet UILabel *descp;
#property (nonatomic, retain)IBOutlet UILabel *tags;
#property (nonatomic, retain)IBOutlet UILabel *catag;
#property (nonatomic, retain)IBOutlet UILabel *account;
#property (nonatomic, retain)IBOutlet UILabel *pub;
#property (nonatomic, retain)IBOutlet UILabel *pub1;
#property (nonatomic, retain)IBOutlet UILabel *unlist;
#property (nonatomic, retain)IBOutlet UILabel *unlist1;
#property (nonatomic, retain)IBOutlet UILabel *priv;
#property (nonatomic, retain)IBOutlet UILabel *priv1;
#property (nonatomic, retain)IBOutlet UILabel *pubdef;
#property (nonatomic, retain)IBOutlet UILabel *unlistdef;
#property (nonatomic, retain)IBOutlet UILabel *privdef;
#property (nonatomic, retain)NSDictionary *pictureDictionary3;
#property (nonatomic, retain)NSDictionary *pictureDictionary4;
#property (nonatomic, retain)IBOutlet UIButton *cancel;
#property (nonatomic, retain) IBOutlet UITextField *number;
#property (nonatomic, copy) NSDictionary *titleTextAttributes;
#property(nonatomic, assign) UIModalTransitionStyle modalTransitionStyle;
#property (nonatomic, retain) IBOutlet UILabel *authfailed;
#property (nonatomic, retain) IBOutlet UILabel *YouTubesignin;
#property (nonatomic, retain) IBOutlet UILabel *YouTubesignout;
#property (nonatomic, retain) IBOutlet UILabel *YouTubesignoutacc;
#property (nonatomic, retain) IBOutlet UITextView *errorfailed;
-(IBAction)publish:(id)sender;
-(IBAction)SignInSave:(id)sender;
This is one example. I'm sorry there is so much code but I thought I should include everything for you to look at
I suspect the problem is because of the compiler being too new for used SDK. The new clang will enable ARC, but old SDK is not made to compile with ARC.

Pass data back to previous view controller causing eroor?

I have a view controller HomeController & BookController.I am going from view controller HomeController to BookController.I am passing data back to previous view controller.So i have used this approach.
#import <UIKit/UIKit.h>
#import "BaseController.h"
#import <MediaPlayer/MediaPlayer.h>
#protocol HomeProtocol
- (void)setComment:(BOOL)data;
-(void)setCommnetArray:(NSMutableArray*)data;
#end
#protocol BookProtocol
-(void)setBook:(BOOL)status;
#end
#interface HomeViewController : BaseController<UITableViewDataSource,UITableViewDelegate,HomeProtocol,UIScrollViewDelegate,BookProtocol,UINavigationControllerDelegate>
#property (weak, nonatomic) IBOutlet UITableView *table_view;
#property BOOL hasUserPostedComment;
#property NSInteger commentIndex;
#property (weak, nonatomic) IBOutlet UILabel *label_post_status;
#property UIRefreshControl *refreshControl;
#property NSInteger start_offset;
#property NSInteger end_offset;
#property (weak, nonatomic) IBOutlet UIButton *btn_refresh;
#property NSMutableArray *temp_user_cooments;
#property MPMoviePlayerController *moviePlayerController;
#property BOOL isBookMarkLoaded;
#end
BookMarkController.h
#import <UIKit/UIKit.h>
#import "BaseController.h"
#import "HomeViewController.h"
#import <MediaPlayer/MediaPlayer.h>
#protocol HomeProtocol
- (void)setComment:(BOOL)data;
-(void)setCommnetArray:(NSMutableArray*)data;
#end
#interface BookMarkController : BaseController<UITableViewDataSource,UITableViewDelegate,HomeProtocol,UIScrollViewDelegate>
#property (nonatomic, weak) id<BookProtocol> myDelegate;
#property (weak, nonatomic) IBOutlet UITableView *table_view;
#property BOOL hasUserPostedComment;
#property NSInteger commentIndex;
#property (weak, nonatomic) IBOutlet UILabel *label_post_status;
#property UIRefreshControl *refreshControl;
#property NSInteger start_offset;
#property NSInteger end_offset;
#property (weak, nonatomic) IBOutlet UIButton *btn_refresh;
#property NSMutableArray *temp_user_cooments;
#property MPMoviePlayerController *moviePlayerController;
#property NSString *index;
#end
Method implementation
-(void)setBook
{
NSLog(#"set book called");
self.isBookMarkLoaded=true;
}
It gives error Unrecognized selector sent to instance.Please tell me what is the issue here.
#protocol BookProtocol
-(void)setBook:(BOOL)status;
#end
Add above protocol to BookMarkController.h. Create delegate of the same in BookMarkController.h file. Make a call to -(void)setBook:(BOOL)status; from BookMarkController.m file
Add delegate in HomeViewController.h file. Define -(void)setBook:(BOOL)status; in HomeViewController.m file and also assign delegate to self.
That's all.

How do I set another ViewController's property without using a segue?

From my MCSettingsFormViewController, I want to set MatchCenterViewController's didAddNewItem BOOL property, but without making use of a segue.
I've imported MatchCenterViewController.h, which contains that property like so:
#property (assign) BOOL didAddNewItem;
However, when I try to set it like this: MatchCenterViewController.didAddNewItem = YES;, it says "property didAddNewItem not found on object of type 'MatchCenterViewController'".
I assume this is because I haven't defined what MatchCenterViewController is. If so, how can I do this property so it sets the property correctly?
edit:
MatchCenterViewController.h:
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "AsyncImageView.h"
#import "SearchViewController.h"
#import "WebViewController.h"
#import "WSCoachMarksView.h"
#import "SLExpandableTableView.h"
#interface MatchCenterViewController : UIViewController <UITableViewDataSource>
#property (strong, nonatomic) NSString *itemSearch;
#property (strong, nonatomic) NSString *itemPriority;
//#property (strong, nonatomic) IBOutlet UITextField *itemSearch;
#property (nonatomic, strong) NSArray *imageURLs;
#property (strong, nonatomic) NSString *matchingCategoryCondition;
#property (strong, nonatomic) NSString *matchingCategoryLocation;
#property (strong, nonatomic) NSNumber *matchingCategoryMaxPrice;
#property (strong, nonatomic) NSNumber *matchingCategoryMinPrice;
#property (strong, nonatomic) NSNumber *matchingCategoryId;
#property (strong, nonatomic) NSArray *matchCenterArray;
#property (strong, nonatomic) NSString *searchTerm;
#property (strong, nonatomic) NSString *itemURL;
#property (assign) NSInteger expandedSection;
#property (assign) NSInteger rowCount;
#property (assign) BOOL didAddNewItem;
#property (assign) BOOL results;
#property (strong, nonatomic) IBOutlet UIButton *editButton;
#property (weak, nonatomic) IBOutlet UIButton *moreButton;
#property (strong) NSMutableSet *expandedSections;
#end
#interface MoreButton : UIButton
#property (assign) NSInteger expandedSection;
#property (assign) NSInteger sectionIndex;
#end
MCSettingsFormViewController.h:
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <Parse/Parse.h>
#import "MatchCenterViewController.h"
#interface MCSettingsFormViewController : UIViewController
#property (strong, nonatomic) NSString *minPrice;
#property (strong, nonatomic) NSString *maxPrice;
#property (strong, nonatomic) NSString *itemCondition;
#property (strong, nonatomic) NSString *itemLocation;
#property (strong, nonatomic) NSString *searchTerm;
#property (strong, nonatomic) NSString *itemPriority;
#property (strong, nonatomic) IBOutlet UITextField *tf;
#property (strong, nonatomic) IBOutlet UITextField *tf1;
#property (strong, nonatomic) IBOutlet UITextField *tf2;
#end
You need to use an instance of MatchCenterViewController not the name of the class. Presumably, somewhere in your app there's a reference to a MatchCenterViewController object. You can either access that reference or pick a different way of letting it know about the change.
For example, if your two controllers aren't connected to each other, you could post a notification in MCSettingsFormViewController and react to it in MatchCenterViewController.
For more specific suggestions, I'd need to know how both controllers are created and presented.
When you instantiate MatchCenterViewController, you could set it as a delegate of MCSettingsFormViewController. That way, the MatchCenterViewController defines itself as the instantiated version of the class to be edited by the MatchCenterViewController.
Here is a basic tutorial for delegates: http://www.tutorialspoint.com/ios/ios_delegates.htm
So based off of your headers, it looks like either your MCSettingsFormViewController doesn't have a property of type MatchCenterViewController-- or that property is private.
In the former case, you need to add a property to your MCSettingsFormViewController with type MatchCenterViewController.
In the latter you aren't initializing your MatchCenterViewController property.
So first, make sure you have that public/private property.
Then, when you first create and show your SettingsFormViewController, set this property to your MatchCenterViewController instance. Now your SettingsForm has a reference to the proper instance you're looking for.
At this point, you can set the property on the MatchCenter

abandoned memory problems with the heap

I am trying to learn a bit about the instruments panel in Xcode. I am using ARC. When checking allocations I have been coming up with some abandoned memory it issues. The picture below depicts code from my prepareForSegue method. Every time I tap to perform the segue, memory is allocated and never released. So if I go back and forth between the two viewControllers, the memory keeps climbing and eventually terminates the app. I used the tools to narrow down the problems in the code but am unsure where to go from here. I have seen several examples online about how to identify the problem but not about how to resolve it. So my question is, what is going on here that is causing the app to not release the memory?
properties for viewController 1:
#property (nonatomic, retain) NSMutableArray *recAlbumsArray;
#property (nonatomic, retain) NSMutableArray *titlesArray;
#property (nonatomic, retain) NSMutableArray *timersArray;
#property (nonatomic, retain) NSMutableArray *albumsArray;
#property (nonatomic, retain) NSMutableArray *imagesArray;
#property (nonatomic, retain) NSMutableArray *objsIdArray;
#property (nonatomic, retain) NSArray *imagesDataArray;
#property (nonatomic, weak) NSArray *recAlbumData;
#property (nonatomic, weak) NSArray *albumData;
#property (nonatomic, weak) NSString *albumTitle;
#property (nonatomic, weak) NSString *objId;
properties for viewController 2:
#property (nonatomic, retain) NSMutableArray *album;
#property (nonatomic, weak) NSString *title;
#property (nonatomic, weak) NSString *albumRef;
#property (nonatomic, weak) NSString *objId;
I have tried setting all the properties to nil in a viewDidDisappear method and also tried removing the 1st viewController from the viewController array hierarchy but nothing changed.

Weird unknown type name issue

So I have this -
#import <UIKit/UIKit.h>
#import "RateView.h"
#interface BasicCardViewController : UIViewController<RateViewDelegate>
#property (weak, nonatomic) IBOutlet UILabel *label;
#property(copy, nonatomic)NSString *message;
#property(atomic)NSInteger rating;
#property (strong, nonatomic) IBOutlet RateView *rateView;
#property (weak, nonatomic) IBOutlet UILabel *ratingLabel;
#end
and this - in my RateView.h file.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#class RateView;
#protocol RateViewDelegate
-(void)rateView:(RateView *)rateView ratingDidChange:(float)rating;
#end
#interface RateView : UIView
#property(strong,nonatomic)UIImage* fullSelectedStar;
#property(strong,nonatomic)UIImage* notSelectedStar;
#property(strong, nonatomic)UIImage* halfSelectedStar;
#property (assign, nonatomic)float rating;
#property(assign) BOOL editable;
#property (strong) NSMutableArray* imageViews;
#property(assign,nonatomic) int maxRating;
#property(assign) int midMargin;
#property(assign)int leftMargin;
#property (assign) CGSize minImageSize;
#property (assign) id <RateViewDelegate> delegate;
#end
But I get two errors -
1.Cannot find protocol declaration for 'TooviaRateViewDelegate'
2.Unknown type name "RateView"
I've tried to clean, and I've verified that the files are where they should be (their filepaths are to the project).
Why is this happening?
Edit - my AppDelegate.h
#import <UIKit/UIKit.h>
#import "SearchViewController.h"
#interface TooviaAppDelegate : UIResponder <UIApplicationDelegate>
#property (strong, nonatomic) UIWindow *window;
#property NSOperationQueue *queue;
#property (strong, nonatomic) NSDictionary *userProfile;
#property (strong, nonatomic) SearchViewController *searchViewController;
- (NSOperationQueue*) getOperationQueue;
- (id)getSettings:(NSString *)keyPath;
- (void) saveCookies;
#end
There are also issues in my SearchViewController
#import <UIKit/UIKit.h>
#import "BasicCardViewController.h"
#interface SearchViewController : UIViewController
<UISearchBarDelegate, UISearchDisplayDelegate, UITableViewDataSource, UITableViewDelegate>
- (IBAction)searchButtonClicked:(UIButton *)sender;
- (IBAction)backgroundTap:(id)sender;
#property (weak, nonatomic) IBOutlet UITableView *resultTable;
#property (weak, nonatomic) IBOutlet UITextField *searchBar;
#property (strong, nonatomic) NSArray *resultsTuples;
#property (weak, nonatomic) IBOutlet UIButton *searchButton;
#property (copy, nonatomic) NSArray *controllers;
#property(strong,nonatomic)BasicCardViewController *detailController;
Delegate and data source properties are usually marked as weak for the object graph management reasons described earlier, in “Avoid Strong Reference Cycles.”

Resources