Skip to content

Commit

Permalink
Switch from garbage collection to ARC.
Browse files Browse the repository at this point in the history
  • Loading branch information
uliwitness committed Apr 26, 2015
1 parent f3495ec commit f5a65ce
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Info.plist
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>2</string>
<key>NSPrincipalClass</key>
<string>iTunesCantComplainView</string>
</dict>
Expand Down
Binary file modified NoAlbumArt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added NoAlbumArt.pxm
Binary file not shown.
22 changes: 13 additions & 9 deletions iTunesCantComplain.xcodeproj/project.pbxproj
Expand Up @@ -165,6 +165,9 @@
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
};
buildConfigurationList = EF7AD73108BB986600CE4634 /* Build configuration list for PBXProject "iTunesCantComplain" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
Expand Down Expand Up @@ -232,10 +235,11 @@
EF7AD72E08BB986600CE4634 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand All @@ -251,13 +255,9 @@
EF7AD72F08BB986600CE4634 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
x86_64,
ppc,
i386,
);
CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = iTunesCantComplain_Prefix.pch;
Expand All @@ -273,8 +273,10 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
VALID_ARCHS = x86_64;
};
name = Debug;
};
Expand All @@ -283,8 +285,10 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
VALID_ARCHS = x86_64;
};
name = Release;
};
Expand Down
10 changes: 5 additions & 5 deletions iTunesCantComplainView.h
Expand Up @@ -20,11 +20,11 @@
float currTrackPercentage;
}

@property(retain) NSImage* currTrackArt;
@property(retain) NSString* currTrackArtist;
@property(retain) NSString* currTrackAlbum;
@property(retain) NSString* currTrackName;
@property(retain) NSString* currTrackLyrics;
@property(strong) NSImage* currTrackArt;
@property(strong) NSString* currTrackArtist;
@property(strong) NSString* currTrackAlbum;
@property(strong) NSString* currTrackName;
@property(strong) NSString* currTrackLyrics;
@property float currTrackPercentage;
@property NSPoint imagePos;

Expand Down
10 changes: 2 additions & 8 deletions iTunesCantComplainView.m
Expand Up @@ -44,13 +44,7 @@ -(void) dealloc
name: @"com.apple.iTunes.playerInfo"
object: nil];

[currTrackArt release];
[currTrackArtist release];
[currTrackAlbum release];
[currTrackName release];
[currTrackLyrics release];

[super dealloc];
}

- (void)startAnimation
Expand Down Expand Up @@ -171,14 +165,14 @@ -(void) iTunesTrackChanged: (NSNotification*)notif
iTunesTrack* currTrack = [itunes currentTrack];
NSArray* theImages = [[currTrack artworks] get];
NSString* imgPath = [[NSBundle bundleForClass: [self class]] pathForImageResource: @"NoAlbumArt"];
NSImage* noAlbumArt = [[[NSImage alloc] initWithContentsOfFile: imgPath] autorelease];
NSImage* noAlbumArt = [[NSImage alloc] initWithContentsOfFile: imgPath];

NS_DURING
if( [theImages count] > 0 )
{
NSImage * possibleImage = [(iTunesArtwork*)[theImages objectAtIndex: 0] data];
if( [possibleImage isKindOfClass: [NSAppleEventDescriptor class]] )
possibleImage = [[[NSImage alloc] initWithData: [(NSAppleEventDescriptor*)possibleImage data]] autorelease];
possibleImage = [[NSImage alloc] initWithData: [(NSAppleEventDescriptor*)possibleImage data]];
[self setCurrTrackArt: possibleImage];
}
else
Expand Down

0 comments on commit f5a65ce

Please sign in to comment.