Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC enabled #11

Merged
merged 1 commit into from
Jul 27, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ARC enabled
  • Loading branch information
weekwood committed Jul 23, 2013
commit 08c5374863651819fba25d76266da3cce549f70b
2 changes: 2 additions & 0 deletions Demo/GCPlaceholderTextViewDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand All @@ -267,6 +268,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "GCPlaceholderTextViewDemo/GCPlaceholderTextViewDemo-Prefix.pch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@interface GCPlaceholderTextViewDemoAppDelegate : NSObject <UIApplicationDelegate>

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet GCPlaceholderTextViewDemoViewController *viewController;
@property (nonatomic, strong) IBOutlet UIWindow *window;
@property (nonatomic, strong) IBOutlet GCPlaceholderTextViewDemoViewController *viewController;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,5 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

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

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@interface GCPlaceholderTextViewDemoViewController : UIViewController

@property (nonatomic, retain) IBOutlet GCPlaceholderTextView *textView;
@property (nonatomic, strong) IBOutlet GCPlaceholderTextView *textView;

- (IBAction)finish:(id)sender;
- (IBAction)refreshText:(id)sender;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ - (IBAction)refreshText:(id)sender {
[self.textView setText:@""];
}

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

- (void)viewDidUnload
{
Expand Down
8 changes: 4 additions & 4 deletions Demo/GCPlaceholderTextViewDemo/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, nil);
return retVal;
}
}
4 changes: 2 additions & 2 deletions GCPlaceholderTextView/GCPlaceholderTextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@interface GCPlaceholderTextView : UITextView

@property(nonatomic, retain) NSString *placeholder;
@property (nonatomic, retain) UIColor *placeholderColor;
@property(nonatomic, strong) NSString *placeholder;
@property (nonatomic, strong) UIColor *placeholderColor;

@end
12 changes: 3 additions & 9 deletions GCPlaceholderTextView/GCPlaceholderTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

@interface GCPlaceholderTextView ()

@property (nonatomic, retain) UIColor* realTextColor;
@property (nonatomic, readonly) NSString* realText;
@property (nonatomic, strong) UIColor* realTextColor;
@property (unsafe_unretained, nonatomic, readonly) NSString* realText;

- (void) beginEditing:(NSNotification*) notification;
- (void) endEditing:(NSNotification*) notification;
Expand Down Expand Up @@ -50,8 +50,7 @@ - (void) setPlaceholder:(NSString *)aPlaceholder {
self.text = aPlaceholder;
}
if (aPlaceholder != placeholder) {
[placeholder autorelease];
placeholder = [aPlaceholder retain];
placeholder = aPlaceholder;
}


Expand Down Expand Up @@ -116,13 +115,8 @@ - (void) setTextColor:(UIColor *)textColor {
#pragma mark Dealloc

- (void)dealloc {
[realTextColor release];
realTextColor = nil;
[placeholder release];
placeholder = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];

[super dealloc];
}

@end