Permalink
Browse files

Added __unsafe_unretained on delegate ivars.

I don't know if this is necessary or not, but it seems like a good
annotation just for humans, if anything, and could make it easier to
switch them all to __weak sometime later which is probably what they
should be if it weren't for 10.6 not supporting it...
  • Loading branch information...
BigZaphod committed Jul 28, 2011
1 parent 278e8cf commit 2db957d404e089fb1e719045921e69aecc3d5b36
@@ -46,7 +46,7 @@ typedef enum MFMailComposeResult MFMailComposeResult;
@interface MFMailComposeViewController : UINavigationController {
@private
- id<MFMailComposeViewControllerDelegate> _mailComposeDelegate;
+ __unsafe_unretained id<MFMailComposeViewControllerDelegate> _mailComposeDelegate;
}
+ (BOOL)canSendMail;
@@ -43,7 +43,7 @@ enum MessageComposeResult {
typedef enum MessageComposeResult MessageComposeResult;
@interface MFMessageComposeViewController : NSObject {
- id<MFMessageComposeViewControllerDelegate> _messageComposeDelegate;
+ __unsafe_unretained id<MFMessageComposeViewControllerDelegate> _messageComposeDelegate;
NSArray *_recipients;
NSString *_body;
}
@@ -34,7 +34,7 @@
@interface SKRequest : NSObject {
@private
- id<SKRequestDelegate> _delegate;
+ __unsafe_unretained id<SKRequestDelegate> _delegate;
}
@property(nonatomic, assign) id<SKRequestDelegate> delegate;
@@ -45,7 +45,7 @@
@interface NSFetchedResultsController : NSObject {
- id <NSFetchedResultsControllerDelegate> _delegate;
+ __unsafe_unretained id <NSFetchedResultsControllerDelegate> _delegate;
NSFetchRequest *_fetchRequest;
NSManagedObjectContext *_managedObjectContext;
NSArray *_fetchedObjects; // we don't yet support sections!
@@ -38,7 +38,7 @@
@interface UIAccelerometer : NSObject {
@private
NSTimeInterval _updateInterval;
- id<UIAccelerometerDelegate> _delegate;
+ __unsafe_unretained id<UIAccelerometerDelegate> _delegate;
}
+ (UIAccelerometer *)sharedAccelerometer;
View
@@ -30,7 +30,7 @@
#import <Foundation/Foundation.h>
@interface UIAction : NSObject {
- id _target;
+ __unsafe_unretained id _target;
SEL _action;
}
@@ -51,7 +51,7 @@ typedef enum {
@interface UIActionSheet : UIView {
@private
- id<UIActionSheetDelegate> _delegate;
+ __unsafe_unretained id<UIActionSheetDelegate> _delegate;
NSInteger _destructiveButtonIndex;
NSInteger _cancelButtonIndex;
NSInteger _firstOtherButtonIndex;
@@ -35,7 +35,7 @@
@private
NSString *_title;
NSString *_message;
- id<UIAlertViewDelegate> _delegate;
+ __unsafe_unretained id<UIAlertViewDelegate> _delegate;
NSInteger _cancelButtonIndex;
NSMutableArray *_buttonTitles;
@@ -99,7 +99,7 @@ extern const NSTimeInterval UIMinimumKeepAliveTimeout;
UIEvent *_currentEvent;
UIWindow *_keyWindow;
NSMutableSet *_visibleWindows;
- id<UIApplicationDelegate> _delegate;
+ __unsafe_unretained id<UIApplicationDelegate> _delegate;
BOOL _idleTimerDisabled;
BOOL _networkActivityIndicatorVisible;
BOOL _applicationSupportsShakeToEdit;
@@ -67,7 +67,7 @@ typedef enum {
@package
CGFloat _width;
UIView *_customView;
- id _target;
+ __unsafe_unretained id _target;
SEL _action;
BOOL _isSystemItem;
UIBarButtonSystemItem _systemItem;
@@ -50,7 +50,7 @@ typedef enum {
@interface UIGestureRecognizer : NSObject {
@private
- id _delegate;
+ __unsafe_unretained id _delegate;
BOOL _delaysTouchesBegan;
BOOL _delaysTouchesEnded;
BOOL _cancelsTouchesInView;
@@ -44,7 +44,7 @@
@private
NSMutableArray *_navStack;
UIColor *_tintColor;
- id _delegate;
+ __unsafe_unretained id _delegate;
UIView *_leftView;
UIView *_centerView;
@@ -42,7 +42,7 @@
UINavigationBar *_navigationBar;
UIToolbar *_toolbar;
NSMutableArray *_viewControllers;
- id _delegate;
+ __unsafe_unretained id _delegate;
BOOL _toolbarHidden;
BOOL _navigationBarHidden;
@@ -38,8 +38,8 @@
@protocol UIPickerViewDataSource, UIPickerViewDelegate;
@interface UIPickerView : UIView {
- id<UIPickerViewDataSource> _dataSource;
- id<UIPickerViewDelegate> _delegate;
+ __unsafe_unretained id<UIPickerViewDataSource> _dataSource;
+ __unsafe_unretained id<UIPickerViewDelegate> _delegate;
BOOL _showsSelectionIndicator;
}
@@ -58,7 +58,7 @@ typedef NSUInteger UIPopoverArrowDirection;
id _popoverWindow;
id _overlayWindow;
- id _delegate;
+ __unsafe_unretained id _delegate;
struct {
BOOL popoverControllerDidDismissPopover : 1;
BOOL popoverControllerShouldDismissPopover : 1;
@@ -56,7 +56,7 @@ extern const float UIScrollViewDecelerationRateFast;
@interface UIScrollView : UIView {
@package
- id _delegate;
+ __unsafe_unretained id _delegate;
@private
CGPoint _contentOffset;
CGSize _contentSize;
@@ -42,7 +42,7 @@ CGFloat UIScrollerWidthForBoundsSize(CGSize boundsSize);
@interface UIScroller : UIView {
@private
- id _delegate;
+ __unsafe_unretained id<_UIScrollerDelegate> _delegate;
CGFloat _contentOffset;
CGFloat _contentSize;
CGFloat _dragOffset;
@@ -41,7 +41,7 @@
@interface UISearchBar : UIView {
UITextField *_searchField;
BOOL _showsCancelButton;
- id<UISearchBarDelegate> _delegate;
+ __unsafe_unretained id<UISearchBarDelegate> _delegate;
NSString *_placeholder;
}
@@ -42,9 +42,9 @@
UIViewController *_viewController;
UISearchBar *_searchBar;
UITableView *_tableView;
- id<UISearchDisplayDelegate> _delegate;
- id<UITableViewDataSource> _tableViewDataSource;
- id<UITableViewDelegate> _tableViewDelegate;
+ __unsafe_unretained id<UISearchDisplayDelegate> _delegate;
+ __unsafe_unretained id<UITableViewDataSource> _tableViewDataSource;
+ __unsafe_unretained id<UITableViewDelegate> _tableViewDelegate;
}
- (id)initWithSearchBar:(UISearchBar *)searchBar contentsController:(UIViewController *)viewController;
@@ -33,7 +33,7 @@
@interface UISplitViewController : UIViewController {
@private
- id <UISplitViewControllerDelegate> _delegate;
+ __unsafe_unretained id <UISplitViewControllerDelegate> _delegate;
NSArray *_viewControllers;
struct {
View
@@ -52,7 +52,7 @@
@interface UITabBar : UIView {
- id<UITabBarDelegate> _delegate;
+ __unsafe_unretained id<UITabBarDelegate> _delegate;
NSArray *_items;
NSInteger _selectedItemIndex;
}
@@ -43,7 +43,7 @@
@class UITabBar;
@interface UITabBarController : UIViewController {
UITabBar *_tabBar;
- UIViewController *_selectedViewController;
+ __unsafe_unretained UIViewController *_selectedViewController;
NSArray *_viewControllers;
NSUInteger _selectedIndex;
}
@@ -91,7 +91,7 @@ typedef enum {
@interface UITableView : UIScrollView {
@private
UITableViewStyle _style;
- id<UITableViewDataSource> _dataSource;
+ __unsafe_unretained id<UITableViewDataSource> _dataSource;
BOOL _needsReload;
CGFloat _rowHeight;
UIColor *_separatorColor;
@@ -67,7 +67,7 @@ typedef enum {
@private
UITextLayer *_textLayer;
- id _delegate;
+ __unsafe_unretained id _delegate;
UITextFieldViewMode _clearButtonMode;
UIView *_leftView;
UITextFieldViewMode _leftViewMode;
@@ -53,7 +53,7 @@ typedef enum {
@interface UITransitionView : UIView {
UITransition _transition;
UIView *_view;
- id<UITransitionViewDelegate> _delegate;
+ __unsafe_unretained id<UITransitionViewDelegate> _delegate;
}
- (id)initWithFrame:(CGRect)frame view:(UIView *)aView;
@@ -51,7 +51,7 @@ typedef NSUInteger UIWebViewNavigationType;
@interface UIWebView : UIView {
@private
- id _delegate;
+ __unsafe_unretained id _delegate;
NSURLRequest *_request;
UIDataDetectorTypes _dataDetectorTypes;
WebView *_webView;

0 comments on commit 2db957d

Please sign in to comment.