Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Remove -fno-obcj-arc flags from UIKit+StaticLibSpec target
Browse files Browse the repository at this point in the history
  • Loading branch information
wileykestner committed Aug 22, 2015
1 parent 59efc14 commit 774b3bb
Show file tree
Hide file tree
Showing 28 changed files with 135 additions and 175 deletions.
2 changes: 1 addition & 1 deletion UIKit/Core/Extensions/UIImageView+PivotalCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@implementation UIImageView (PivotalCore)

+ (UIImageView *)imageViewWithImageNamed:(NSString *)imageName {
return [[[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]] autorelease];
return [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__block NSAttributedString *attributedString;

beforeEach(^{
attributedString = [[[NSAttributedString alloc] initWithString:@"" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17.0f]}] autorelease];
attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17.0f]}];
});

describe(@"heightWithWidth:", ^{
Expand All @@ -31,7 +31,7 @@

context(@"short string", ^{
beforeEach(^{
attributedString = [[[NSAttributedString alloc] initWithString:@"short string" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17.0f]}] autorelease];
attributedString = [[NSAttributedString alloc] initWithString:@"short string" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17.0f]}];
});

it(@"should return the correct height", ^{
Expand All @@ -41,7 +41,7 @@

context(@"long string", ^{
beforeEach(^{
attributedString = [[[NSAttributedString alloc] initWithString:@"really a very a long, probably unnecessarily long, string that undoubtedly will require several lines to render within the given height" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17.0]}] autorelease];
attributedString = [[NSAttributedString alloc] initWithString:@"really a very a long, probably unnecessarily long, string that undoubtedly will require several lines to render within the given height" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17.0]}];
});

it(@"should return the correct height", ^{
Expand Down
4 changes: 2 additions & 2 deletions UIKit/Spec/Extensions/UIBarButtonItem+ButtonSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__block UIBarButtonItem *barButtonItem;

beforeEach(^{
button = [[[UIButton alloc] init] autorelease];
button = [[UIButton alloc] init];
barButtonItem = [UIBarButtonItem barButtonItemUsingButton:button];
});

Expand All @@ -23,7 +23,7 @@
});

it(@"should return nil for button if the bar button item is created in another way", ^{
barButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:nil] autorelease];
barButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:nil];
barButtonItem.button should be_nil();
});
});
Expand Down
12 changes: 6 additions & 6 deletions UIKit/Spec/Extensions/UIBarButtonItemSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
__block Target *target;

beforeEach(^{
target = [[Target new] autorelease];
target = [[Target alloc] init];
spy_on(target);

barButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
barButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:target
action:@selector(hello)] autorelease];
action:@selector(hello)];
});

it(@"can be 'tapped' programmatically", ^{
Expand All @@ -31,9 +31,9 @@
});

it(@"should pass itself as sender if the action selector takes an argument", ^{
barButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
barButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:target
action:@selector(ciao:)] autorelease];
action:@selector(ciao:)];
[barButtonItem tap];
target should have_received(@selector(ciao:)).with(barButtonItem);
});
Expand All @@ -43,7 +43,7 @@
[button addTarget:target
action:@selector(hello)
forControlEvents:UIControlEventTouchUpInside];
barButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:button] autorelease];
barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
[barButtonItem tap];

target should have_received(@selector(hello));
Expand Down
4 changes: 2 additions & 2 deletions UIKit/Spec/Extensions/UICollectionViewCellSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
delegate stub_method(@selector(collectionView:shouldSelectItemAtIndexPath:)).and_return(YES);
delegate stub_method(@selector(collectionView:didSelectItemAtIndexPath:));

UICollectionViewFlowLayout *layout = [[[UICollectionViewFlowLayout alloc] init] autorelease];
controller = [[[SpecCollectionViewController alloc] initWithCollectionViewLayout:layout] autorelease];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
controller = [[SpecCollectionViewController alloc] initWithCollectionViewLayout:layout];
controller.collectionView.delegate = delegate;
controller.view should_not be_nil;
[controller.view layoutIfNeeded];
Expand Down
2 changes: 1 addition & 1 deletion UIKit/Spec/Extensions/UIControlSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__block Target *target;

beforeEach(^{
target = [[[Target alloc] init] autorelease];
target = [[Target alloc] init];
spy_on(target);

button = [UIButton buttonWithType:UIButtonTypeCustom];
Expand Down
12 changes: 6 additions & 6 deletions UIKit/Spec/Extensions/UIGestureRecognizerSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ @implementation SpecGestureRecognizerViewController @end
__block UIView *view;

beforeEach(^{
view = [[[UIView alloc] init] autorelease];
target = [[[Target alloc] init] autorelease];
view = [[UIView alloc] init];
target = [[Target alloc] init];
spy_on(target);
});

Expand Down Expand Up @@ -119,7 +119,7 @@ target stub_method(@selector(ciao:)).and_do_block(^(UIGestureRecognizer *gesture
describe(@"when additional targets are set", ^{
__block Target *newTarget;
beforeEach(^{
newTarget = [[[Target alloc] init] autorelease];
newTarget = [[Target alloc] init];
spy_on(newTarget);
[recognizer addTarget:newTarget action:@selector(goodbye)];
});
Expand All @@ -134,7 +134,7 @@ target stub_method(@selector(ciao:)).and_do_block(^(UIGestureRecognizer *gesture
describe(@"when a target that takes the recognizer as an argument is set", ^{
__block Target *newTarget;
beforeEach(^{
newTarget = [[[Target alloc] init] autorelease];
newTarget = [[Target alloc] init];
spy_on(newTarget);
[recognizer addTarget:newTarget action:@selector(ciao:)];
});
Expand All @@ -149,15 +149,15 @@ target stub_method(@selector(ciao:)).and_do_block(^(UIGestureRecognizer *gesture

context(@"for a gesture recognizer created in code", ^{
beforeEach(^{
recognizer = [[[UITapGestureRecognizer alloc] initWithTarget:target action:@selector(hello)] autorelease];
recognizer = [[UITapGestureRecognizer alloc] initWithTarget:target action:@selector(hello)];
[view addGestureRecognizer:recognizer];
});

itShouldBehaveLike(@"triggering a gesture recognizer");

describe(@"when initialized without a target or action", ^{
it(@"should not raise", ^{
UITapGestureRecognizer *recognizer = [[[UITapGestureRecognizer alloc] initWithTarget:nil action:nil] autorelease];
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:nil action:nil];
[view addGestureRecognizer:recognizer];
^{
[recognizer recognize];
Expand Down
2 changes: 1 addition & 1 deletion UIKit/Spec/Extensions/UIImageView+PivotalCoreSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__block UIImageView *returnedImageView;

beforeEach(^{
imageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default-568h"]] autorelease];
imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default-568h"]];
returnedImageView = [UIImageView imageViewWithImageNamed:@"Default-568h"];
});

Expand Down
2 changes: 1 addition & 1 deletion UIKit/Spec/Extensions/UISliderSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
beforeEach(^{
target = [NSMutableArray array];
spy_on(target);
slider = [[[UISlider alloc] init] autorelease];
slider = [[UISlider alloc] init];
[slider addTarget:target action:@selector(removeAllObjects) forControlEvents:UIControlEventValueChanged];
});

Expand Down
4 changes: 2 additions & 2 deletions UIKit/Spec/Extensions/UISwitchSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
__block Target *target;

beforeEach(^{
target = [[[Target alloc] init] autorelease];
target = [[Target alloc] init];
spy_on(target);

uiswitch = [[[UISwitch alloc] init] autorelease];
uiswitch = [[UISwitch alloc] init];
[uiswitch addTarget:target action:@selector(ciao:) forControlEvents:UIControlEventValueChanged];
});

Expand Down
6 changes: 3 additions & 3 deletions UIKit/Spec/Extensions/UITabBarControllerSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
__block id<UITabBarControllerDelegate, CedarDouble> delegate;
__block UIViewController *viewController0, *viewController1;
beforeEach(^{
controller = [[[UITabBarController alloc] init] autorelease];
controller = [[UITabBarController alloc] init];

delegate = fake_for(@protocol(UITabBarControllerDelegate));
controller.delegate = delegate;

viewController0 = [[[UIViewController alloc] init] autorelease];
viewController1 = [[[UIViewController alloc] init] autorelease];
viewController0 = [[UIViewController alloc] init];
viewController1 = [[UIViewController alloc] init];
controller.viewControllers = @[viewController0, viewController1];
});

Expand Down
2 changes: 1 addition & 1 deletion UIKit/Spec/Extensions/UITableViewCellSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
__block UITableViewCell *cell;

beforeEach(^{
controller = [[[SpecTableViewController alloc] initWithStyle:UITableViewStylePlain] autorelease];
controller = [[SpecTableViewController alloc] initWithStyle:UITableViewStylePlain];
controller.shouldHightlightRows = YES;
controller.view should_not be_nil;
[controller.view layoutIfNeeded];
Expand Down
2 changes: 1 addition & 1 deletion UIKit/Spec/Extensions/UIView+PivotalCoreSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__block CGRect oldFrame;

beforeEach(^{
view = [[[UIView alloc] initWithFrame:CGRectMake(50, 10, 200, 100)] autorelease];
view = [[UIView alloc] initWithFrame:CGRectMake(50, 10, 200, 100)];
oldFrame = view.frame;
});

Expand Down
40 changes: 20 additions & 20 deletions UIKit/Spec/Extensions/UIViewSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
__block Target *target, *otherTarget;

beforeEach(^{
view = [[[UIView alloc] init] autorelease];
target = [[[Target alloc] init] autorelease];
view = [[UIView alloc] init];
target = [[Target alloc] init];
spy_on(target);

otherTarget = [[[Target alloc] init] autorelease];
otherTarget = [[Target alloc] init];
spy_on(otherTarget);
});

describe(@"tapping on the view", ^{
beforeEach(^{
UITapGestureRecognizer *tapRecognizer = [[[UITapGestureRecognizer alloc] init] autorelease];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] init];
[tapRecognizer addTarget:target action:@selector(hello)];

UISwipeGestureRecognizer *swipeRecognizer = [[[UISwipeGestureRecognizer alloc] init] autorelease];
UISwipeGestureRecognizer *swipeRecognizer = [[UISwipeGestureRecognizer alloc] init];
[swipeRecognizer addTarget:otherTarget action:@selector(hello)];

[view addGestureRecognizer:tapRecognizer];
Expand All @@ -44,10 +44,10 @@

describe(@"swiping the view", ^{
beforeEach(^{
UISwipeGestureRecognizer *swipeRecognizer = [[[UISwipeGestureRecognizer alloc] init] autorelease];
UISwipeGestureRecognizer *swipeRecognizer = [[UISwipeGestureRecognizer alloc] init];
[swipeRecognizer addTarget:target action:@selector(hello)];

UITapGestureRecognizer *tapRecognizer = [[[UITapGestureRecognizer alloc] init] autorelease];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] init];
[tapRecognizer addTarget:otherTarget action:@selector(hello)];

[view addGestureRecognizer:tapRecognizer];
Expand All @@ -74,22 +74,22 @@
rightTarget = nice_fake_for([Target class]);
downTarget = nice_fake_for([Target class]);

UISwipeGestureRecognizer *upSwipeRecognizer = [[[UISwipeGestureRecognizer alloc] init] autorelease];
UISwipeGestureRecognizer *upSwipeRecognizer = [[UISwipeGestureRecognizer alloc] init];
upSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionUp;

[upSwipeRecognizer addTarget:upTarget action:@selector(hello)];

UISwipeGestureRecognizer *leftSwipeRecognizer = [[[UISwipeGestureRecognizer alloc] init] autorelease];
UISwipeGestureRecognizer *leftSwipeRecognizer = [[UISwipeGestureRecognizer alloc] init];
leftSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;

[leftSwipeRecognizer addTarget:leftTarget action:@selector(hello)];

UISwipeGestureRecognizer *rightSwipeRecognizer = [[[UISwipeGestureRecognizer alloc] init] autorelease];
UISwipeGestureRecognizer *rightSwipeRecognizer = [[UISwipeGestureRecognizer alloc] init];
rightSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight;

[rightSwipeRecognizer addTarget:rightTarget action:@selector(hello)];

UISwipeGestureRecognizer *downSwipeRecognizer = [[[UISwipeGestureRecognizer alloc] init] autorelease];
UISwipeGestureRecognizer *downSwipeRecognizer = [[UISwipeGestureRecognizer alloc] init];
downSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionDown;

[downSwipeRecognizer addTarget:downTarget action:@selector(hello)];
Expand Down Expand Up @@ -135,10 +135,10 @@

describe(@"pinching the view", ^{
beforeEach(^{
UIPinchGestureRecognizer *pinchRecognizer = [[[UIPinchGestureRecognizer alloc] init] autorelease];
UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] init];
[pinchRecognizer addTarget:target action:@selector(hello)];

UITapGestureRecognizer *tapRecognizer = [[[UITapGestureRecognizer alloc] init] autorelease];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] init];
[tapRecognizer addTarget:otherTarget action:@selector(hello)];

[view addGestureRecognizer:tapRecognizer];
Expand All @@ -159,9 +159,9 @@
__block UIView *subview2;

beforeEach(^{
view = [[[UIView alloc] init] autorelease];
subview1 = [[[UIView alloc] init] autorelease];
subview2 = [[[UIView alloc] init] autorelease];
view = [[UIView alloc] init];
subview1 = [[UIView alloc] init];
subview2 = [[UIView alloc] init];

[subview1 setAccessibilityIdentifier:@"I, Robot"];
[subview2 setAccessibilityIdentifier:@"Foundation"];
Expand All @@ -184,10 +184,10 @@
__block UILabel *subsubview;

beforeEach(^{
view = [[[UIView alloc] init] autorelease];
subview1 = [[[UIView alloc] init] autorelease];
subview2 = [[[UILabel alloc] init] autorelease];
subsubview = [[[UILabel alloc] init] autorelease];
view = [[UIView alloc] init];
subview1 = [[UIView alloc] init];
subview2 = [[UILabel alloc] init];
subsubview = [[UILabel alloc] init];

[view addSubview:subview1];
[view addSubview:subview2];
Expand Down
12 changes: 6 additions & 6 deletions UIKit/Spec/Extensions/UIWindowSpec+Spec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
__block UITextField *firstResponderGrandchild;

beforeEach(^{
window = [[[UIWindow alloc] init] autorelease];
UITextField *child1 = [[[UITextField alloc] init] autorelease];
UITextField *child2 = [[[UITextField alloc] init] autorelease];
UITextField *grandchild1 = [[[UITextField alloc] init] autorelease];
UITextField *grandchild2 = [[[UITextField alloc] init] autorelease];
firstResponderGrandchild = [[[UITextField alloc] init] autorelease];
window = [[UIWindow alloc] init];
UITextField *child1 = [[UITextField alloc] init];
UITextField *child2 = [[UITextField alloc] init];
UITextField *grandchild1 = [[UITextField alloc] init];
UITextField *grandchild2 = [[UITextField alloc] init];
firstResponderGrandchild = [[UITextField alloc] init];

[window addSubview:child1];
[window addSubview:child2];
Expand Down
3 changes: 2 additions & 1 deletion UIKit/Spec/Fixtures/ChildViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#import <UIKit/UIKit.h>


@interface ChildViewController : UIViewController

@property (retain, nonatomic) IBOutlet UILabel *helloLabel;
@property (weak, nonatomic) IBOutlet UILabel *helloLabel;

@end
7 changes: 1 addition & 6 deletions UIKit/Spec/Fixtures/ChildViewController.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#import "ChildViewController.h"

@implementation ChildViewController

- (void)dealloc {
[_helloLabel release];
[super dealloc];
}

@implementation ChildViewController
@end
8 changes: 4 additions & 4 deletions UIKit/Spec/Fixtures/InnerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

@interface InnerView : UIView

@property (retain, nonatomic) IBOutlet UIView *subview;
@property (retain, nonatomic) IBOutlet UIView *anotherSubview;
@property (retain, nonatomic) IBOutlet NSLayoutConstraint *verticalSpace;
@property (retain, nonatomic) IBOutlet NSLayoutConstraint *horizontalSpace;
@property (weak, nonatomic) IBOutlet UIView *subview;
@property (weak, nonatomic) IBOutlet UIView *anotherSubview;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *verticalSpace;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *horizontalSpace;

@end
8 changes: 0 additions & 8 deletions UIKit/Spec/Fixtures/InnerView.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
#import "InnerView.h"

@implementation InnerView

- (void)dealloc {
[_subview release];
[_anotherSubview release];
[_verticalSpace release];
[_horizontalSpace release];
[super dealloc];
}
@end
Loading

0 comments on commit 774b3bb

Please sign in to comment.