├── Example1 ├── LionTableViewTesting.xcodeproj │ └── project.pbxproj └── LionTableViewTesting │ ├── Item.h │ ├── Item.m │ ├── LionTableViewTesting-Info.plist │ ├── LionTableViewTesting-Prefix.pch │ ├── LionTableViewTestingAppDelegate.h │ ├── LionTableViewTestingAppDelegate.m │ ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m ├── Example2 ├── LionTableViewTesting.xcodeproj │ └── project.pbxproj └── LionTableViewTesting │ ├── Item.h │ ├── Item.m │ ├── ItemCellView.h │ ├── ItemCellView.m │ ├── LionTableViewTesting-Info.plist │ ├── LionTableViewTesting-Prefix.pch │ ├── LionTableViewTestingAppDelegate.h │ ├── LionTableViewTestingAppDelegate.m │ ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m ├── Example3 ├── LionTableViewTesting.xcodeproj │ └── project.pbxproj └── LionTableViewTesting │ ├── Item.h │ ├── Item.m │ ├── ItemCellView.h │ ├── ItemCellView.m │ ├── LionTableViewTesting-Info.plist │ ├── LionTableViewTesting-Prefix.pch │ ├── LionTableViewTestingAppDelegate.h │ ├── LionTableViewTestingAppDelegate.m │ ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m ├── Example4 ├── LionTableViewTesting.xcodeproj │ └── project.pbxproj └── LionTableViewTesting │ ├── Item.h │ ├── Item.m │ ├── ItemCellView.h │ ├── ItemCellView.m │ ├── LionTableViewTesting-Info.plist │ ├── LionTableViewTesting-Prefix.pch │ ├── LionTableViewTestingAppDelegate.h │ ├── LionTableViewTestingAppDelegate.m │ ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m ├── Example5 ├── LionTableViewTesting.xcodeproj │ └── project.pbxproj └── LionTableViewTesting │ ├── Item.h │ ├── Item.m │ ├── ItemCellView.h │ ├── ItemCellView.m │ ├── LionTableViewTesting-Info.plist │ ├── LionTableViewTesting-Prefix.pch │ ├── LionTableViewTestingAppDelegate.h │ ├── LionTableViewTestingAppDelegate.m │ ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m └── Readme.markdown /Example1/LionTableViewTesting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73002CDA140ABCF60035299A /* Cocoa.framework */; }; 11 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE3140ABCF60035299A /* InfoPlist.strings */; }; 12 | 73002CE7140ABCF60035299A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CE6140ABCF60035299A /* main.m */; }; 13 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE9140ABCF60035299A /* Credits.rtf */; }; 14 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */; }; 15 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 73002CEF140ABCF60035299A /* MainMenu.xib */; }; 16 | 73002CF9140AD6570035299A /* Item.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CF8140AD6570035299A /* Item.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LionTableViewTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 73002CDA140ABCF60035299A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 22 | 73002CDD140ABCF60035299A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 23 | 73002CDE140ABCF60035299A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 24 | 73002CDF140ABCF60035299A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 25 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LionTableViewTesting-Info.plist"; sourceTree = ""; }; 26 | 73002CE4140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 27 | 73002CE6140ABCF60035299A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 28 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LionTableViewTesting-Prefix.pch"; sourceTree = ""; }; 29 | 73002CEA140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 30 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LionTableViewTestingAppDelegate.h; sourceTree = ""; }; 31 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LionTableViewTestingAppDelegate.m; sourceTree = ""; }; 32 | 73002CF0140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 33 | 73002CF7140AD6570035299A /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Item.h; sourceTree = ""; }; 34 | 73002CF8140AD6570035299A /* Item.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Item.m; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 73002CD3140ABCF60035299A /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */, 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | 73002CCB140ABCF60035299A = { 50 | isa = PBXGroup; 51 | children = ( 52 | 73002CE0140ABCF60035299A /* LionTableViewTesting */, 53 | 73002CD9140ABCF60035299A /* Frameworks */, 54 | 73002CD7140ABCF60035299A /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | 73002CD7140ABCF60035299A /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | 73002CD9140ABCF60035299A /* Frameworks */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 73002CDA140ABCF60035299A /* Cocoa.framework */, 70 | 73002CDC140ABCF60035299A /* Other Frameworks */, 71 | ); 72 | name = Frameworks; 73 | sourceTree = ""; 74 | }; 75 | 73002CDC140ABCF60035299A /* Other Frameworks */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 73002CDD140ABCF60035299A /* AppKit.framework */, 79 | 73002CDE140ABCF60035299A /* CoreData.framework */, 80 | 73002CDF140ABCF60035299A /* Foundation.framework */, 81 | ); 82 | name = "Other Frameworks"; 83 | sourceTree = ""; 84 | }; 85 | 73002CE0140ABCF60035299A /* LionTableViewTesting */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 73002CF7140AD6570035299A /* Item.h */, 89 | 73002CF8140AD6570035299A /* Item.m */, 90 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */, 91 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */, 92 | 73002CEF140ABCF60035299A /* MainMenu.xib */, 93 | 73002CE1140ABCF60035299A /* Supporting Files */, 94 | ); 95 | path = LionTableViewTesting; 96 | sourceTree = ""; 97 | }; 98 | 73002CE1140ABCF60035299A /* Supporting Files */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */, 102 | 73002CE3140ABCF60035299A /* InfoPlist.strings */, 103 | 73002CE6140ABCF60035299A /* main.m */, 104 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */, 105 | 73002CE9140ABCF60035299A /* Credits.rtf */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXNativeTarget section */ 113 | 73002CD5140ABCF60035299A /* LionTableViewTesting */ = { 114 | isa = PBXNativeTarget; 115 | buildConfigurationList = 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */; 116 | buildPhases = ( 117 | 73002CD2140ABCF60035299A /* Sources */, 118 | 73002CD3140ABCF60035299A /* Frameworks */, 119 | 73002CD4140ABCF60035299A /* Resources */, 120 | ); 121 | buildRules = ( 122 | ); 123 | dependencies = ( 124 | ); 125 | name = LionTableViewTesting; 126 | productName = LionTableViewTesting; 127 | productReference = 73002CD6140ABCF60035299A /* LionTableViewTesting.app */; 128 | productType = "com.apple.product-type.application"; 129 | }; 130 | /* End PBXNativeTarget section */ 131 | 132 | /* Begin PBXProject section */ 133 | 73002CCD140ABCF60035299A /* Project object */ = { 134 | isa = PBXProject; 135 | buildConfigurationList = 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */; 136 | compatibilityVersion = "Xcode 3.2"; 137 | developmentRegion = English; 138 | hasScannedForEncodings = 0; 139 | knownRegions = ( 140 | en, 141 | ); 142 | mainGroup = 73002CCB140ABCF60035299A; 143 | productRefGroup = 73002CD7140ABCF60035299A /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | 73002CD5140ABCF60035299A /* LionTableViewTesting */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | 73002CD4140ABCF60035299A /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */, 158 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */, 159 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXSourcesBuildPhase section */ 166 | 73002CD2140ABCF60035299A /* Sources */ = { 167 | isa = PBXSourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 73002CE7140ABCF60035299A /* main.m in Sources */, 171 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */, 172 | 73002CF9140AD6570035299A /* Item.m in Sources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXSourcesBuildPhase section */ 177 | 178 | /* Begin PBXVariantGroup section */ 179 | 73002CE3140ABCF60035299A /* InfoPlist.strings */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | 73002CE4140ABCF60035299A /* en */, 183 | ); 184 | name = InfoPlist.strings; 185 | sourceTree = ""; 186 | }; 187 | 73002CE9140ABCF60035299A /* Credits.rtf */ = { 188 | isa = PBXVariantGroup; 189 | children = ( 190 | 73002CEA140ABCF60035299A /* en */, 191 | ); 192 | name = Credits.rtf; 193 | sourceTree = ""; 194 | }; 195 | 73002CEF140ABCF60035299A /* MainMenu.xib */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 73002CF0140ABCF60035299A /* en */, 199 | ); 200 | name = MainMenu.xib; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXVariantGroup section */ 204 | 205 | /* Begin XCBuildConfiguration section */ 206 | 73002CF2140ABCF60035299A /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 211 | COPY_PHASE_STRIP = NO; 212 | GCC_C_LANGUAGE_STANDARD = gnu99; 213 | GCC_DYNAMIC_NO_PIC = NO; 214 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 215 | GCC_OPTIMIZATION_LEVEL = 0; 216 | GCC_PREPROCESSOR_DEFINITIONS = ( 217 | "DEBUG=1", 218 | "$(inherited)", 219 | ); 220 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 221 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 224 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 225 | GCC_WARN_UNUSED_VARIABLE = YES; 226 | MACOSX_DEPLOYMENT_TARGET = 10.7; 227 | ONLY_ACTIVE_ARCH = YES; 228 | SDKROOT = macosx; 229 | }; 230 | name = Debug; 231 | }; 232 | 73002CF3140ABCF60035299A /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 237 | COPY_PHASE_STRIP = YES; 238 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 239 | GCC_C_LANGUAGE_STANDARD = gnu99; 240 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 241 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 242 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 243 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 244 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 245 | GCC_WARN_UNUSED_VARIABLE = YES; 246 | MACOSX_DEPLOYMENT_TARGET = 10.7; 247 | SDKROOT = macosx; 248 | }; 249 | name = Release; 250 | }; 251 | 73002CF5140ABCF60035299A /* Debug */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 255 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 256 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 257 | PRODUCT_NAME = "$(TARGET_NAME)"; 258 | WRAPPER_EXTENSION = app; 259 | }; 260 | name = Debug; 261 | }; 262 | 73002CF6140ABCF60035299A /* Release */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 266 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 267 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 268 | PRODUCT_NAME = "$(TARGET_NAME)"; 269 | WRAPPER_EXTENSION = app; 270 | }; 271 | name = Release; 272 | }; 273 | /* End XCBuildConfiguration section */ 274 | 275 | /* Begin XCConfigurationList section */ 276 | 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */ = { 277 | isa = XCConfigurationList; 278 | buildConfigurations = ( 279 | 73002CF2140ABCF60035299A /* Debug */, 280 | 73002CF3140ABCF60035299A /* Release */, 281 | ); 282 | defaultConfigurationIsVisible = 0; 283 | defaultConfigurationName = Release; 284 | }; 285 | 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */ = { 286 | isa = XCConfigurationList; 287 | buildConfigurations = ( 288 | 73002CF5140ABCF60035299A /* Debug */, 289 | 73002CF6140ABCF60035299A /* Release */, 290 | ); 291 | defaultConfigurationIsVisible = 0; 292 | }; 293 | /* End XCConfigurationList section */ 294 | }; 295 | rootObject = 73002CCD140ABCF60035299A /* Project object */; 296 | } 297 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // Item.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface Item : NSObject 10 | 11 | @property (nonatomic, copy) NSString *itemPath; 12 | @property (nonatomic, readonly) NSString *itemDisplayName; 13 | @property (nonatomic, readonly) NSString *itemKind; 14 | @property (nonatomic, readonly) NSImage *itemIcon; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/Item.m: -------------------------------------------------------------------------------- 1 | // 2 | // Item.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | 11 | @implementation Item 12 | 13 | @synthesize itemDisplayName = _itemDisplayName; 14 | @synthesize itemPath = _itemPath; 15 | @synthesize itemKind = _itemKind; 16 | @synthesize itemIcon = _itemIcon; 17 | 18 | - (void)dealloc { 19 | [_itemDisplayName release], _itemDisplayName = nil; 20 | [_itemPath release], _itemPath = nil; 21 | [_itemKind release], _itemKind = nil; 22 | [_itemIcon release], _itemIcon = nil; 23 | [super dealloc]; 24 | } 25 | 26 | - (NSString *)itemDisplayName { 27 | if (_itemDisplayName) return _itemDisplayName; 28 | _itemDisplayName = [[[NSFileManager defaultManager] displayNameAtPath:self.itemPath] retain]; 29 | return _itemDisplayName; 30 | } 31 | 32 | - (NSString *)itemKind { 33 | if (_itemKind) return _itemKind; 34 | if ([self.itemPath hasSuffix:@"app"]) 35 | _itemKind = @"Application"; 36 | else 37 | _itemKind = @"Folder"; 38 | return _itemKind; 39 | } 40 | 41 | - (NSImage *)itemIcon { 42 | if (_itemIcon) return _itemIcon; 43 | _itemIcon = [[[NSWorkspace sharedWorkspace] iconForFile:self.itemPath] retain]; 44 | return _itemIcon; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/LionTableViewTesting-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.gentlebytes.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/LionTableViewTesting-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LionTableViewTesting' target in the 'LionTableViewTesting' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/LionTableViewTestingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface LionTableViewTestingAppDelegate : NSObject 10 | 11 | @property (assign) IBOutlet NSWindow *window; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/LionTableViewTestingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | #import "LionTableViewTestingAppDelegate.h" 11 | 12 | @interface LionTableViewTestingAppDelegate () 13 | 14 | @property (nonatomic, readonly) NSArray *items; 15 | 16 | @end 17 | 18 | #pragma mark - 19 | 20 | @implementation LionTableViewTestingAppDelegate 21 | 22 | @synthesize window = _window; 23 | @synthesize items = _items; 24 | 25 | #pragma mark - NSApplicationDelegate 26 | 27 | - (void)applicationDidFinishLaunching:(NSNotification *)note { 28 | // Nothing to do here for this simple app... 29 | } 30 | 31 | #pragma mark - NSTableViewDataSource 32 | 33 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { 34 | return [self.items count]; 35 | } 36 | 37 | - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 38 | NSTableCellView *result = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; 39 | Item *item = [self.items objectAtIndex:row]; 40 | result.imageView.image = item.itemIcon; 41 | result.textField.stringValue = item.itemDisplayName; 42 | return result; 43 | } 44 | 45 | #pragma mark - NSTableViewDelegate 46 | 47 | #pragma mark - Login items 48 | 49 | - (NSArray *)items { 50 | if (_items) return _items; 51 | NSFileManager *manager = [NSFileManager defaultManager]; 52 | NSArray *contents = [manager contentsOfDirectoryAtPath:@"/Applications" error:nil]; 53 | NSMutableArray *items = [NSMutableArray arrayWithCapacity:[contents count]]; 54 | [contents enumerateObjectsUsingBlock:^(NSString *filename, NSUInteger idx, BOOL *stop) { 55 | if ([filename hasPrefix:@"."]) return; 56 | Item *item = [[[Item alloc] init] autorelease]; 57 | item.itemPath = [@"/Applications" stringByAppendingPathComponent:filename]; 58 | [items addObject:item]; 59 | }]; 60 | _items = [items retain]; 61 | return _items; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example1/LionTableViewTesting/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73002CDA140ABCF60035299A /* Cocoa.framework */; }; 11 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE3140ABCF60035299A /* InfoPlist.strings */; }; 12 | 73002CE7140ABCF60035299A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CE6140ABCF60035299A /* main.m */; }; 13 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE9140ABCF60035299A /* Credits.rtf */; }; 14 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */; }; 15 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 73002CEF140ABCF60035299A /* MainMenu.xib */; }; 16 | 73002CF9140AD6570035299A /* Item.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CF8140AD6570035299A /* Item.m */; }; 17 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 73D521E6140B6DA400D98CC2 /* ItemCellView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LionTableViewTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 73002CDA140ABCF60035299A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 23 | 73002CDD140ABCF60035299A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 24 | 73002CDE140ABCF60035299A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 25 | 73002CDF140ABCF60035299A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LionTableViewTesting-Info.plist"; sourceTree = ""; }; 27 | 73002CE4140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 28 | 73002CE6140ABCF60035299A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LionTableViewTesting-Prefix.pch"; sourceTree = ""; }; 30 | 73002CEA140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 31 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LionTableViewTestingAppDelegate.h; sourceTree = ""; }; 32 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LionTableViewTestingAppDelegate.m; sourceTree = ""; }; 33 | 73002CF0140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 34 | 73002CF7140AD6570035299A /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Item.h; sourceTree = ""; }; 35 | 73002CF8140AD6570035299A /* Item.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Item.m; sourceTree = ""; }; 36 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemCellView.h; sourceTree = ""; }; 37 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemCellView.m; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 73002CD3140ABCF60035299A /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 73002CCB140ABCF60035299A = { 53 | isa = PBXGroup; 54 | children = ( 55 | 73002CE0140ABCF60035299A /* LionTableViewTesting */, 56 | 73002CD9140ABCF60035299A /* Frameworks */, 57 | 73002CD7140ABCF60035299A /* Products */, 58 | ); 59 | sourceTree = ""; 60 | }; 61 | 73002CD7140ABCF60035299A /* Products */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */, 65 | ); 66 | name = Products; 67 | sourceTree = ""; 68 | }; 69 | 73002CD9140ABCF60035299A /* Frameworks */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 73002CDA140ABCF60035299A /* Cocoa.framework */, 73 | 73002CDC140ABCF60035299A /* Other Frameworks */, 74 | ); 75 | name = Frameworks; 76 | sourceTree = ""; 77 | }; 78 | 73002CDC140ABCF60035299A /* Other Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 73002CDD140ABCF60035299A /* AppKit.framework */, 82 | 73002CDE140ABCF60035299A /* CoreData.framework */, 83 | 73002CDF140ABCF60035299A /* Foundation.framework */, 84 | ); 85 | name = "Other Frameworks"; 86 | sourceTree = ""; 87 | }; 88 | 73002CE0140ABCF60035299A /* LionTableViewTesting */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 73002CF7140AD6570035299A /* Item.h */, 92 | 73002CF8140AD6570035299A /* Item.m */, 93 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */, 94 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */, 95 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */, 96 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */, 97 | 73002CEF140ABCF60035299A /* MainMenu.xib */, 98 | 73002CE1140ABCF60035299A /* Supporting Files */, 99 | ); 100 | path = LionTableViewTesting; 101 | sourceTree = ""; 102 | }; 103 | 73002CE1140ABCF60035299A /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */, 107 | 73002CE3140ABCF60035299A /* InfoPlist.strings */, 108 | 73002CE6140ABCF60035299A /* main.m */, 109 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */, 110 | 73002CE9140ABCF60035299A /* Credits.rtf */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 73002CD5140ABCF60035299A /* LionTableViewTesting */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */; 121 | buildPhases = ( 122 | 73002CD2140ABCF60035299A /* Sources */, 123 | 73002CD3140ABCF60035299A /* Frameworks */, 124 | 73002CD4140ABCF60035299A /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = LionTableViewTesting; 131 | productName = LionTableViewTesting; 132 | productReference = 73002CD6140ABCF60035299A /* LionTableViewTesting.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | /* End PBXNativeTarget section */ 136 | 137 | /* Begin PBXProject section */ 138 | 73002CCD140ABCF60035299A /* Project object */ = { 139 | isa = PBXProject; 140 | buildConfigurationList = 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */; 141 | compatibilityVersion = "Xcode 3.2"; 142 | developmentRegion = English; 143 | hasScannedForEncodings = 0; 144 | knownRegions = ( 145 | en, 146 | ); 147 | mainGroup = 73002CCB140ABCF60035299A; 148 | productRefGroup = 73002CD7140ABCF60035299A /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 73002CD5140ABCF60035299A /* LionTableViewTesting */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 73002CD4140ABCF60035299A /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */, 163 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */, 164 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 73002CD2140ABCF60035299A /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 73002CE7140ABCF60035299A /* main.m in Sources */, 176 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */, 177 | 73002CF9140AD6570035299A /* Item.m in Sources */, 178 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 73002CE3140ABCF60035299A /* InfoPlist.strings */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 73002CE4140ABCF60035299A /* en */, 189 | ); 190 | name = InfoPlist.strings; 191 | sourceTree = ""; 192 | }; 193 | 73002CE9140ABCF60035299A /* Credits.rtf */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 73002CEA140ABCF60035299A /* en */, 197 | ); 198 | name = Credits.rtf; 199 | sourceTree = ""; 200 | }; 201 | 73002CEF140ABCF60035299A /* MainMenu.xib */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 73002CF0140ABCF60035299A /* en */, 205 | ); 206 | name = MainMenu.xib; 207 | sourceTree = ""; 208 | }; 209 | /* End PBXVariantGroup section */ 210 | 211 | /* Begin XCBuildConfiguration section */ 212 | 73002CF2140ABCF60035299A /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 217 | COPY_PHASE_STRIP = NO; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 227 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | MACOSX_DEPLOYMENT_TARGET = 10.7; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = macosx; 235 | }; 236 | name = Debug; 237 | }; 238 | 73002CF3140ABCF60035299A /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 243 | COPY_PHASE_STRIP = YES; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | GCC_C_LANGUAGE_STANDARD = gnu99; 246 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 247 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | MACOSX_DEPLOYMENT_TARGET = 10.7; 253 | SDKROOT = macosx; 254 | }; 255 | name = Release; 256 | }; 257 | 73002CF5140ABCF60035299A /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 261 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 262 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | WRAPPER_EXTENSION = app; 265 | }; 266 | name = Debug; 267 | }; 268 | 73002CF6140ABCF60035299A /* Release */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 272 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 273 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 274 | PRODUCT_NAME = "$(TARGET_NAME)"; 275 | WRAPPER_EXTENSION = app; 276 | }; 277 | name = Release; 278 | }; 279 | /* End XCBuildConfiguration section */ 280 | 281 | /* Begin XCConfigurationList section */ 282 | 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */ = { 283 | isa = XCConfigurationList; 284 | buildConfigurations = ( 285 | 73002CF2140ABCF60035299A /* Debug */, 286 | 73002CF3140ABCF60035299A /* Release */, 287 | ); 288 | defaultConfigurationIsVisible = 0; 289 | defaultConfigurationName = Release; 290 | }; 291 | 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | 73002CF5140ABCF60035299A /* Debug */, 295 | 73002CF6140ABCF60035299A /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | /* End XCConfigurationList section */ 301 | }; 302 | rootObject = 73002CCD140ABCF60035299A /* Project object */; 303 | } 304 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // Item.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface Item : NSObject 10 | 11 | @property (nonatomic, copy) NSString *itemPath; 12 | @property (nonatomic, readonly) NSString *itemDisplayName; 13 | @property (nonatomic, readonly) NSString *itemKind; 14 | @property (nonatomic, readonly) NSImage *itemIcon; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/Item.m: -------------------------------------------------------------------------------- 1 | // 2 | // Item.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | 11 | @implementation Item 12 | 13 | @synthesize itemDisplayName = _itemDisplayName; 14 | @synthesize itemPath = _itemPath; 15 | @synthesize itemKind = _itemKind; 16 | @synthesize itemIcon = _itemIcon; 17 | 18 | - (void)dealloc { 19 | [_itemDisplayName release], _itemDisplayName = nil; 20 | [_itemPath release], _itemPath = nil; 21 | [_itemKind release], _itemKind = nil; 22 | [_itemIcon release], _itemIcon = nil; 23 | [super dealloc]; 24 | } 25 | 26 | - (NSString *)itemDisplayName { 27 | if (_itemDisplayName) return _itemDisplayName; 28 | _itemDisplayName = [[[NSFileManager defaultManager] displayNameAtPath:self.itemPath] retain]; 29 | return _itemDisplayName; 30 | } 31 | 32 | - (NSString *)itemKind { 33 | if (_itemKind) return _itemKind; 34 | if ([self.itemPath hasSuffix:@"app"]) 35 | _itemKind = @"Application"; 36 | else 37 | _itemKind = @"Folder"; 38 | return _itemKind; 39 | } 40 | 41 | - (NSImage *)itemIcon { 42 | if (_itemIcon) return _itemIcon; 43 | _itemIcon = [[[NSWorkspace sharedWorkspace] iconForFile:self.itemPath] retain]; 44 | return _itemIcon; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/ItemCellView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface ItemCellView : NSTableCellView 10 | 11 | @property (nonatomic, retain) IBOutlet NSTextField *detailTextField; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/ItemCellView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ItemCellView.h" 10 | 11 | @implementation ItemCellView 12 | 13 | @synthesize detailTextField = _detailTextField; 14 | 15 | - (void)dealloc { 16 | [_detailTextField release], _detailTextField = nil; 17 | [super dealloc]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/LionTableViewTesting-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.gentlebytes.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/LionTableViewTesting-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LionTableViewTesting' target in the 'LionTableViewTesting' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/LionTableViewTestingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface LionTableViewTestingAppDelegate : NSObject 10 | 11 | @property (assign) IBOutlet NSWindow *window; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/LionTableViewTestingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | #import "ItemCellView.h" 11 | #import "LionTableViewTestingAppDelegate.h" 12 | 13 | @interface LionTableViewTestingAppDelegate () 14 | 15 | @property (nonatomic, readonly) NSArray *items; 16 | 17 | @end 18 | 19 | #pragma mark - 20 | 21 | @implementation LionTableViewTestingAppDelegate 22 | 23 | @synthesize window = _window; 24 | @synthesize items = _items; 25 | 26 | #pragma mark - NSApplicationDelegate 27 | 28 | - (void)applicationDidFinishLaunching:(NSNotification *)note { 29 | // Nothing to do here for this simple app... 30 | } 31 | 32 | #pragma mark - NSTableViewDataSource 33 | 34 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { 35 | return [self.items count]; 36 | } 37 | 38 | - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 39 | ItemCellView *result = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; 40 | Item *item = [self.items objectAtIndex:row]; 41 | result.imageView.image = item.itemIcon; 42 | result.textField.stringValue = item.itemDisplayName; 43 | result.detailTextField.stringValue = item.itemKind; 44 | return result; 45 | } 46 | 47 | #pragma mark - NSTableViewDelegate 48 | 49 | #pragma mark - Login items 50 | 51 | - (NSArray *)items { 52 | if (_items) return _items; 53 | NSFileManager *manager = [NSFileManager defaultManager]; 54 | NSArray *contents = [manager contentsOfDirectoryAtPath:@"/Applications" error:nil]; 55 | NSMutableArray *items = [NSMutableArray arrayWithCapacity:[contents count]]; 56 | [contents enumerateObjectsUsingBlock:^(NSString *filename, NSUInteger idx, BOOL *stop) { 57 | if ([filename hasPrefix:@"."]) return; 58 | Item *item = [[[Item alloc] init] autorelease]; 59 | item.itemPath = [@"/Applications" stringByAppendingPathComponent:filename]; 60 | [items addObject:item]; 61 | }]; 62 | _items = [items retain]; 63 | return _items; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example2/LionTableViewTesting/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73002CDA140ABCF60035299A /* Cocoa.framework */; }; 11 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE3140ABCF60035299A /* InfoPlist.strings */; }; 12 | 73002CE7140ABCF60035299A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CE6140ABCF60035299A /* main.m */; }; 13 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE9140ABCF60035299A /* Credits.rtf */; }; 14 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */; }; 15 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 73002CEF140ABCF60035299A /* MainMenu.xib */; }; 16 | 73002CF9140AD6570035299A /* Item.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CF8140AD6570035299A /* Item.m */; }; 17 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 73D521E6140B6DA400D98CC2 /* ItemCellView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LionTableViewTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 73002CDA140ABCF60035299A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 23 | 73002CDD140ABCF60035299A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 24 | 73002CDE140ABCF60035299A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 25 | 73002CDF140ABCF60035299A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LionTableViewTesting-Info.plist"; sourceTree = ""; }; 27 | 73002CE4140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 28 | 73002CE6140ABCF60035299A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LionTableViewTesting-Prefix.pch"; sourceTree = ""; }; 30 | 73002CEA140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 31 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LionTableViewTestingAppDelegate.h; sourceTree = ""; }; 32 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LionTableViewTestingAppDelegate.m; sourceTree = ""; }; 33 | 73002CF0140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 34 | 73002CF7140AD6570035299A /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Item.h; sourceTree = ""; }; 35 | 73002CF8140AD6570035299A /* Item.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Item.m; sourceTree = ""; }; 36 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemCellView.h; sourceTree = ""; }; 37 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemCellView.m; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 73002CD3140ABCF60035299A /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 73002CCB140ABCF60035299A = { 53 | isa = PBXGroup; 54 | children = ( 55 | 73002CE0140ABCF60035299A /* LionTableViewTesting */, 56 | 73002CD9140ABCF60035299A /* Frameworks */, 57 | 73002CD7140ABCF60035299A /* Products */, 58 | ); 59 | sourceTree = ""; 60 | }; 61 | 73002CD7140ABCF60035299A /* Products */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */, 65 | ); 66 | name = Products; 67 | sourceTree = ""; 68 | }; 69 | 73002CD9140ABCF60035299A /* Frameworks */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 73002CDA140ABCF60035299A /* Cocoa.framework */, 73 | 73002CDC140ABCF60035299A /* Other Frameworks */, 74 | ); 75 | name = Frameworks; 76 | sourceTree = ""; 77 | }; 78 | 73002CDC140ABCF60035299A /* Other Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 73002CDD140ABCF60035299A /* AppKit.framework */, 82 | 73002CDE140ABCF60035299A /* CoreData.framework */, 83 | 73002CDF140ABCF60035299A /* Foundation.framework */, 84 | ); 85 | name = "Other Frameworks"; 86 | sourceTree = ""; 87 | }; 88 | 73002CE0140ABCF60035299A /* LionTableViewTesting */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 73002CF7140AD6570035299A /* Item.h */, 92 | 73002CF8140AD6570035299A /* Item.m */, 93 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */, 94 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */, 95 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */, 96 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */, 97 | 73002CEF140ABCF60035299A /* MainMenu.xib */, 98 | 73002CE1140ABCF60035299A /* Supporting Files */, 99 | ); 100 | path = LionTableViewTesting; 101 | sourceTree = ""; 102 | }; 103 | 73002CE1140ABCF60035299A /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */, 107 | 73002CE3140ABCF60035299A /* InfoPlist.strings */, 108 | 73002CE6140ABCF60035299A /* main.m */, 109 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */, 110 | 73002CE9140ABCF60035299A /* Credits.rtf */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 73002CD5140ABCF60035299A /* LionTableViewTesting */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */; 121 | buildPhases = ( 122 | 73002CD2140ABCF60035299A /* Sources */, 123 | 73002CD3140ABCF60035299A /* Frameworks */, 124 | 73002CD4140ABCF60035299A /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = LionTableViewTesting; 131 | productName = LionTableViewTesting; 132 | productReference = 73002CD6140ABCF60035299A /* LionTableViewTesting.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | /* End PBXNativeTarget section */ 136 | 137 | /* Begin PBXProject section */ 138 | 73002CCD140ABCF60035299A /* Project object */ = { 139 | isa = PBXProject; 140 | buildConfigurationList = 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */; 141 | compatibilityVersion = "Xcode 3.2"; 142 | developmentRegion = English; 143 | hasScannedForEncodings = 0; 144 | knownRegions = ( 145 | en, 146 | ); 147 | mainGroup = 73002CCB140ABCF60035299A; 148 | productRefGroup = 73002CD7140ABCF60035299A /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 73002CD5140ABCF60035299A /* LionTableViewTesting */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 73002CD4140ABCF60035299A /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */, 163 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */, 164 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 73002CD2140ABCF60035299A /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 73002CE7140ABCF60035299A /* main.m in Sources */, 176 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */, 177 | 73002CF9140AD6570035299A /* Item.m in Sources */, 178 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 73002CE3140ABCF60035299A /* InfoPlist.strings */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 73002CE4140ABCF60035299A /* en */, 189 | ); 190 | name = InfoPlist.strings; 191 | sourceTree = ""; 192 | }; 193 | 73002CE9140ABCF60035299A /* Credits.rtf */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 73002CEA140ABCF60035299A /* en */, 197 | ); 198 | name = Credits.rtf; 199 | sourceTree = ""; 200 | }; 201 | 73002CEF140ABCF60035299A /* MainMenu.xib */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 73002CF0140ABCF60035299A /* en */, 205 | ); 206 | name = MainMenu.xib; 207 | sourceTree = ""; 208 | }; 209 | /* End PBXVariantGroup section */ 210 | 211 | /* Begin XCBuildConfiguration section */ 212 | 73002CF2140ABCF60035299A /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 217 | COPY_PHASE_STRIP = NO; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 227 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | MACOSX_DEPLOYMENT_TARGET = 10.7; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = macosx; 235 | }; 236 | name = Debug; 237 | }; 238 | 73002CF3140ABCF60035299A /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 243 | COPY_PHASE_STRIP = YES; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | GCC_C_LANGUAGE_STANDARD = gnu99; 246 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 247 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | MACOSX_DEPLOYMENT_TARGET = 10.7; 253 | SDKROOT = macosx; 254 | }; 255 | name = Release; 256 | }; 257 | 73002CF5140ABCF60035299A /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 261 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 262 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | WRAPPER_EXTENSION = app; 265 | }; 266 | name = Debug; 267 | }; 268 | 73002CF6140ABCF60035299A /* Release */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 272 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 273 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 274 | PRODUCT_NAME = "$(TARGET_NAME)"; 275 | WRAPPER_EXTENSION = app; 276 | }; 277 | name = Release; 278 | }; 279 | /* End XCBuildConfiguration section */ 280 | 281 | /* Begin XCConfigurationList section */ 282 | 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */ = { 283 | isa = XCConfigurationList; 284 | buildConfigurations = ( 285 | 73002CF2140ABCF60035299A /* Debug */, 286 | 73002CF3140ABCF60035299A /* Release */, 287 | ); 288 | defaultConfigurationIsVisible = 0; 289 | defaultConfigurationName = Release; 290 | }; 291 | 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | 73002CF5140ABCF60035299A /* Debug */, 295 | 73002CF6140ABCF60035299A /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | /* End XCConfigurationList section */ 301 | }; 302 | rootObject = 73002CCD140ABCF60035299A /* Project object */; 303 | } 304 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // Item.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface Item : NSObject 10 | 11 | @property (nonatomic, copy) NSString *itemPath; 12 | @property (nonatomic, readonly) NSString *itemDisplayName; 13 | @property (nonatomic, readonly) NSString *itemKind; 14 | @property (nonatomic, readonly) NSImage *itemIcon; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/Item.m: -------------------------------------------------------------------------------- 1 | // 2 | // Item.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | 11 | @implementation Item 12 | 13 | @synthesize itemDisplayName = _itemDisplayName; 14 | @synthesize itemPath = _itemPath; 15 | @synthesize itemKind = _itemKind; 16 | @synthesize itemIcon = _itemIcon; 17 | 18 | - (void)dealloc { 19 | [_itemDisplayName release], _itemDisplayName = nil; 20 | [_itemPath release], _itemPath = nil; 21 | [_itemKind release], _itemKind = nil; 22 | [_itemIcon release], _itemIcon = nil; 23 | [super dealloc]; 24 | } 25 | 26 | - (NSString *)itemDisplayName { 27 | if (_itemDisplayName) return _itemDisplayName; 28 | _itemDisplayName = [[[NSFileManager defaultManager] displayNameAtPath:self.itemPath] retain]; 29 | return _itemDisplayName; 30 | } 31 | 32 | - (NSString *)itemKind { 33 | if (_itemKind) return _itemKind; 34 | if ([self.itemPath hasSuffix:@"app"]) 35 | _itemKind = @"Application"; 36 | else 37 | _itemKind = @"Folder"; 38 | return _itemKind; 39 | } 40 | 41 | - (NSImage *)itemIcon { 42 | if (_itemIcon) return _itemIcon; 43 | _itemIcon = [[[NSWorkspace sharedWorkspace] iconForFile:self.itemPath] retain]; 44 | return _itemIcon; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/ItemCellView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface ItemCellView : NSTableCellView 10 | 11 | @property (nonatomic, retain) IBOutlet NSTextField *detailTextField; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/ItemCellView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ItemCellView.h" 10 | 11 | @implementation ItemCellView 12 | 13 | @synthesize detailTextField = _detailTextField; 14 | 15 | - (void)dealloc { 16 | [_detailTextField release], _detailTextField = nil; 17 | [super dealloc]; 18 | } 19 | 20 | - (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle { 21 | NSColor *textColor = (backgroundStyle == NSBackgroundStyleDark) ? [NSColor windowBackgroundColor] : [NSColor controlShadowColor]; 22 | self.detailTextField.textColor = textColor; 23 | [super setBackgroundStyle:backgroundStyle]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/LionTableViewTesting-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.gentlebytes.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/LionTableViewTesting-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LionTableViewTesting' target in the 'LionTableViewTesting' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/LionTableViewTestingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface LionTableViewTestingAppDelegate : NSObject 10 | 11 | @property (assign) IBOutlet NSWindow *window; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/LionTableViewTestingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | #import "ItemCellView.h" 11 | #import "LionTableViewTestingAppDelegate.h" 12 | 13 | @interface LionTableViewTestingAppDelegate () 14 | 15 | @property (nonatomic, readonly) NSArray *items; 16 | 17 | @end 18 | 19 | #pragma mark - 20 | 21 | @implementation LionTableViewTestingAppDelegate 22 | 23 | @synthesize window = _window; 24 | @synthesize items = _items; 25 | 26 | #pragma mark - NSApplicationDelegate 27 | 28 | - (void)applicationDidFinishLaunching:(NSNotification *)note { 29 | // Nothing to do here for this simple app... 30 | } 31 | 32 | #pragma mark - NSTableViewDataSource 33 | 34 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { 35 | return [self.items count]; 36 | } 37 | 38 | - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 39 | ItemCellView *result = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; 40 | Item *item = [self.items objectAtIndex:row]; 41 | result.imageView.image = item.itemIcon; 42 | result.textField.stringValue = item.itemDisplayName; 43 | result.detailTextField.stringValue = item.itemKind; 44 | return result; 45 | } 46 | 47 | #pragma mark - NSTableViewDelegate 48 | 49 | #pragma mark - Login items 50 | 51 | - (NSArray *)items { 52 | if (_items) return _items; 53 | NSFileManager *manager = [NSFileManager defaultManager]; 54 | NSArray *contents = [manager contentsOfDirectoryAtPath:@"/Applications" error:nil]; 55 | NSMutableArray *items = [NSMutableArray arrayWithCapacity:[contents count]]; 56 | [contents enumerateObjectsUsingBlock:^(NSString *filename, NSUInteger idx, BOOL *stop) { 57 | if ([filename hasPrefix:@"."]) return; 58 | Item *item = [[[Item alloc] init] autorelease]; 59 | item.itemPath = [@"/Applications" stringByAppendingPathComponent:filename]; 60 | [items addObject:item]; 61 | }]; 62 | _items = [items retain]; 63 | return _items; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example3/LionTableViewTesting/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73002CDA140ABCF60035299A /* Cocoa.framework */; }; 11 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE3140ABCF60035299A /* InfoPlist.strings */; }; 12 | 73002CE7140ABCF60035299A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CE6140ABCF60035299A /* main.m */; }; 13 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE9140ABCF60035299A /* Credits.rtf */; }; 14 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */; }; 15 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 73002CEF140ABCF60035299A /* MainMenu.xib */; }; 16 | 73002CF9140AD6570035299A /* Item.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CF8140AD6570035299A /* Item.m */; }; 17 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 73D521E6140B6DA400D98CC2 /* ItemCellView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LionTableViewTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 73002CDA140ABCF60035299A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 23 | 73002CDD140ABCF60035299A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 24 | 73002CDE140ABCF60035299A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 25 | 73002CDF140ABCF60035299A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LionTableViewTesting-Info.plist"; sourceTree = ""; }; 27 | 73002CE4140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 28 | 73002CE6140ABCF60035299A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LionTableViewTesting-Prefix.pch"; sourceTree = ""; }; 30 | 73002CEA140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 31 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LionTableViewTestingAppDelegate.h; sourceTree = ""; }; 32 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LionTableViewTestingAppDelegate.m; sourceTree = ""; }; 33 | 73002CF0140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 34 | 73002CF7140AD6570035299A /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Item.h; sourceTree = ""; }; 35 | 73002CF8140AD6570035299A /* Item.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Item.m; sourceTree = ""; }; 36 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemCellView.h; sourceTree = ""; }; 37 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemCellView.m; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 73002CD3140ABCF60035299A /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 73002CCB140ABCF60035299A = { 53 | isa = PBXGroup; 54 | children = ( 55 | 73002CE0140ABCF60035299A /* LionTableViewTesting */, 56 | 73002CD9140ABCF60035299A /* Frameworks */, 57 | 73002CD7140ABCF60035299A /* Products */, 58 | ); 59 | sourceTree = ""; 60 | }; 61 | 73002CD7140ABCF60035299A /* Products */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */, 65 | ); 66 | name = Products; 67 | sourceTree = ""; 68 | }; 69 | 73002CD9140ABCF60035299A /* Frameworks */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 73002CDA140ABCF60035299A /* Cocoa.framework */, 73 | 73002CDC140ABCF60035299A /* Other Frameworks */, 74 | ); 75 | name = Frameworks; 76 | sourceTree = ""; 77 | }; 78 | 73002CDC140ABCF60035299A /* Other Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 73002CDD140ABCF60035299A /* AppKit.framework */, 82 | 73002CDE140ABCF60035299A /* CoreData.framework */, 83 | 73002CDF140ABCF60035299A /* Foundation.framework */, 84 | ); 85 | name = "Other Frameworks"; 86 | sourceTree = ""; 87 | }; 88 | 73002CE0140ABCF60035299A /* LionTableViewTesting */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 73002CF7140AD6570035299A /* Item.h */, 92 | 73002CF8140AD6570035299A /* Item.m */, 93 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */, 94 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */, 95 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */, 96 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */, 97 | 73002CEF140ABCF60035299A /* MainMenu.xib */, 98 | 73002CE1140ABCF60035299A /* Supporting Files */, 99 | ); 100 | path = LionTableViewTesting; 101 | sourceTree = ""; 102 | }; 103 | 73002CE1140ABCF60035299A /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */, 107 | 73002CE3140ABCF60035299A /* InfoPlist.strings */, 108 | 73002CE6140ABCF60035299A /* main.m */, 109 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */, 110 | 73002CE9140ABCF60035299A /* Credits.rtf */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 73002CD5140ABCF60035299A /* LionTableViewTesting */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */; 121 | buildPhases = ( 122 | 73002CD2140ABCF60035299A /* Sources */, 123 | 73002CD3140ABCF60035299A /* Frameworks */, 124 | 73002CD4140ABCF60035299A /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = LionTableViewTesting; 131 | productName = LionTableViewTesting; 132 | productReference = 73002CD6140ABCF60035299A /* LionTableViewTesting.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | /* End PBXNativeTarget section */ 136 | 137 | /* Begin PBXProject section */ 138 | 73002CCD140ABCF60035299A /* Project object */ = { 139 | isa = PBXProject; 140 | buildConfigurationList = 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */; 141 | compatibilityVersion = "Xcode 3.2"; 142 | developmentRegion = English; 143 | hasScannedForEncodings = 0; 144 | knownRegions = ( 145 | en, 146 | ); 147 | mainGroup = 73002CCB140ABCF60035299A; 148 | productRefGroup = 73002CD7140ABCF60035299A /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 73002CD5140ABCF60035299A /* LionTableViewTesting */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 73002CD4140ABCF60035299A /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */, 163 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */, 164 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 73002CD2140ABCF60035299A /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 73002CE7140ABCF60035299A /* main.m in Sources */, 176 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */, 177 | 73002CF9140AD6570035299A /* Item.m in Sources */, 178 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 73002CE3140ABCF60035299A /* InfoPlist.strings */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 73002CE4140ABCF60035299A /* en */, 189 | ); 190 | name = InfoPlist.strings; 191 | sourceTree = ""; 192 | }; 193 | 73002CE9140ABCF60035299A /* Credits.rtf */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 73002CEA140ABCF60035299A /* en */, 197 | ); 198 | name = Credits.rtf; 199 | sourceTree = ""; 200 | }; 201 | 73002CEF140ABCF60035299A /* MainMenu.xib */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 73002CF0140ABCF60035299A /* en */, 205 | ); 206 | name = MainMenu.xib; 207 | sourceTree = ""; 208 | }; 209 | /* End PBXVariantGroup section */ 210 | 211 | /* Begin XCBuildConfiguration section */ 212 | 73002CF2140ABCF60035299A /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 217 | COPY_PHASE_STRIP = NO; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 227 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | MACOSX_DEPLOYMENT_TARGET = 10.7; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = macosx; 235 | }; 236 | name = Debug; 237 | }; 238 | 73002CF3140ABCF60035299A /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 243 | COPY_PHASE_STRIP = YES; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | GCC_C_LANGUAGE_STANDARD = gnu99; 246 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 247 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | MACOSX_DEPLOYMENT_TARGET = 10.7; 253 | SDKROOT = macosx; 254 | }; 255 | name = Release; 256 | }; 257 | 73002CF5140ABCF60035299A /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 261 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 262 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | WRAPPER_EXTENSION = app; 265 | }; 266 | name = Debug; 267 | }; 268 | 73002CF6140ABCF60035299A /* Release */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 272 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 273 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 274 | PRODUCT_NAME = "$(TARGET_NAME)"; 275 | WRAPPER_EXTENSION = app; 276 | }; 277 | name = Release; 278 | }; 279 | /* End XCBuildConfiguration section */ 280 | 281 | /* Begin XCConfigurationList section */ 282 | 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */ = { 283 | isa = XCConfigurationList; 284 | buildConfigurations = ( 285 | 73002CF2140ABCF60035299A /* Debug */, 286 | 73002CF3140ABCF60035299A /* Release */, 287 | ); 288 | defaultConfigurationIsVisible = 0; 289 | defaultConfigurationName = Release; 290 | }; 291 | 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | 73002CF5140ABCF60035299A /* Debug */, 295 | 73002CF6140ABCF60035299A /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | /* End XCConfigurationList section */ 301 | }; 302 | rootObject = 73002CCD140ABCF60035299A /* Project object */; 303 | } 304 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // Item.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface Item : NSObject 10 | 11 | @property (nonatomic, copy) NSString *itemPath; 12 | @property (nonatomic, readonly) NSString *itemDisplayName; 13 | @property (nonatomic, readonly) NSString *itemKind; 14 | @property (nonatomic, readonly) NSImage *itemIcon; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/Item.m: -------------------------------------------------------------------------------- 1 | // 2 | // Item.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | 11 | @implementation Item 12 | 13 | @synthesize itemDisplayName = _itemDisplayName; 14 | @synthesize itemPath = _itemPath; 15 | @synthesize itemKind = _itemKind; 16 | @synthesize itemIcon = _itemIcon; 17 | 18 | - (void)dealloc { 19 | [_itemDisplayName release], _itemDisplayName = nil; 20 | [_itemPath release], _itemPath = nil; 21 | [_itemKind release], _itemKind = nil; 22 | [_itemIcon release], _itemIcon = nil; 23 | [super dealloc]; 24 | } 25 | 26 | - (NSString *)itemDisplayName { 27 | if (_itemDisplayName) return _itemDisplayName; 28 | _itemDisplayName = [[[NSFileManager defaultManager] displayNameAtPath:self.itemPath] retain]; 29 | return _itemDisplayName; 30 | } 31 | 32 | - (NSString *)itemKind { 33 | if (_itemKind) return _itemKind; 34 | if ([self.itemPath hasSuffix:@"app"]) 35 | _itemKind = @"Application"; 36 | else 37 | _itemKind = @"Folder"; 38 | return _itemKind; 39 | } 40 | 41 | - (NSImage *)itemIcon { 42 | if (_itemIcon) return _itemIcon; 43 | _itemIcon = [[[NSWorkspace sharedWorkspace] iconForFile:self.itemPath] retain]; 44 | return _itemIcon; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/ItemCellView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface ItemCellView : NSTableCellView 10 | 11 | @property (nonatomic, retain) IBOutlet NSTextField *detailTextField; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/ItemCellView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ItemCellView.h" 10 | 11 | @implementation ItemCellView 12 | 13 | @synthesize detailTextField = _detailTextField; 14 | 15 | - (void)dealloc { 16 | [_detailTextField release], _detailTextField = nil; 17 | [super dealloc]; 18 | } 19 | 20 | - (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle { 21 | NSColor *textColor = (backgroundStyle == NSBackgroundStyleDark) ? [NSColor windowBackgroundColor] : [NSColor controlShadowColor]; 22 | self.detailTextField.textColor = textColor; 23 | [super setBackgroundStyle:backgroundStyle]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/LionTableViewTesting-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.gentlebytes.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/LionTableViewTesting-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LionTableViewTesting' target in the 'LionTableViewTesting' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/LionTableViewTestingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface LionTableViewTestingAppDelegate : NSObject 10 | 11 | @property (assign) IBOutlet NSWindow *window; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/LionTableViewTestingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | #import "ItemCellView.h" 11 | #import "LionTableViewTestingAppDelegate.h" 12 | 13 | @interface LionTableViewTestingAppDelegate () 14 | 15 | @property (nonatomic, readonly) NSArray *items; 16 | 17 | @end 18 | 19 | #pragma mark - 20 | 21 | @implementation LionTableViewTestingAppDelegate 22 | 23 | @synthesize window = _window; 24 | @synthesize items = _items; 25 | 26 | #pragma mark - NSApplicationDelegate 27 | 28 | - (void)applicationDidFinishLaunching:(NSNotification *)note { 29 | // Nothing to do here for this simple app... 30 | } 31 | 32 | #pragma mark - Login items 33 | 34 | - (NSArray *)items { 35 | if (_items) return _items; 36 | NSFileManager *manager = [NSFileManager defaultManager]; 37 | NSArray *contents = [manager contentsOfDirectoryAtPath:@"/Applications" error:nil]; 38 | NSMutableArray *items = [NSMutableArray arrayWithCapacity:[contents count]]; 39 | [contents enumerateObjectsUsingBlock:^(NSString *filename, NSUInteger idx, BOOL *stop) { 40 | if ([filename hasPrefix:@"."]) return; 41 | Item *item = [[[Item alloc] init] autorelease]; 42 | item.itemPath = [@"/Applications" stringByAppendingPathComponent:filename]; 43 | [items addObject:item]; 44 | }]; 45 | _items = [items retain]; 46 | return _items; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example4/LionTableViewTesting/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73002CDA140ABCF60035299A /* Cocoa.framework */; }; 11 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE3140ABCF60035299A /* InfoPlist.strings */; }; 12 | 73002CE7140ABCF60035299A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CE6140ABCF60035299A /* main.m */; }; 13 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 73002CE9140ABCF60035299A /* Credits.rtf */; }; 14 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */; }; 15 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 73002CEF140ABCF60035299A /* MainMenu.xib */; }; 16 | 73002CF9140AD6570035299A /* Item.m in Sources */ = {isa = PBXBuildFile; fileRef = 73002CF8140AD6570035299A /* Item.m */; }; 17 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 73D521E6140B6DA400D98CC2 /* ItemCellView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LionTableViewTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 73002CDA140ABCF60035299A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 23 | 73002CDD140ABCF60035299A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 24 | 73002CDE140ABCF60035299A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 25 | 73002CDF140ABCF60035299A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LionTableViewTesting-Info.plist"; sourceTree = ""; }; 27 | 73002CE4140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 28 | 73002CE6140ABCF60035299A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LionTableViewTesting-Prefix.pch"; sourceTree = ""; }; 30 | 73002CEA140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 31 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LionTableViewTestingAppDelegate.h; sourceTree = ""; }; 32 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LionTableViewTestingAppDelegate.m; sourceTree = ""; }; 33 | 73002CF0140ABCF60035299A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 34 | 73002CF7140AD6570035299A /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Item.h; sourceTree = ""; }; 35 | 73002CF8140AD6570035299A /* Item.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Item.m; sourceTree = ""; }; 36 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemCellView.h; sourceTree = ""; }; 37 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemCellView.m; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 73002CD3140ABCF60035299A /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | 73002CDB140ABCF60035299A /* Cocoa.framework in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 73002CCB140ABCF60035299A = { 53 | isa = PBXGroup; 54 | children = ( 55 | 73002CE0140ABCF60035299A /* LionTableViewTesting */, 56 | 73002CD9140ABCF60035299A /* Frameworks */, 57 | 73002CD7140ABCF60035299A /* Products */, 58 | ); 59 | sourceTree = ""; 60 | }; 61 | 73002CD7140ABCF60035299A /* Products */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 73002CD6140ABCF60035299A /* LionTableViewTesting.app */, 65 | ); 66 | name = Products; 67 | sourceTree = ""; 68 | }; 69 | 73002CD9140ABCF60035299A /* Frameworks */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 73002CDA140ABCF60035299A /* Cocoa.framework */, 73 | 73002CDC140ABCF60035299A /* Other Frameworks */, 74 | ); 75 | name = Frameworks; 76 | sourceTree = ""; 77 | }; 78 | 73002CDC140ABCF60035299A /* Other Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 73002CDD140ABCF60035299A /* AppKit.framework */, 82 | 73002CDE140ABCF60035299A /* CoreData.framework */, 83 | 73002CDF140ABCF60035299A /* Foundation.framework */, 84 | ); 85 | name = "Other Frameworks"; 86 | sourceTree = ""; 87 | }; 88 | 73002CE0140ABCF60035299A /* LionTableViewTesting */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 73002CF7140AD6570035299A /* Item.h */, 92 | 73002CF8140AD6570035299A /* Item.m */, 93 | 73D521E5140B6DA400D98CC2 /* ItemCellView.h */, 94 | 73D521E6140B6DA400D98CC2 /* ItemCellView.m */, 95 | 73002CEC140ABCF60035299A /* LionTableViewTestingAppDelegate.h */, 96 | 73002CED140ABCF60035299A /* LionTableViewTestingAppDelegate.m */, 97 | 73002CEF140ABCF60035299A /* MainMenu.xib */, 98 | 73002CE1140ABCF60035299A /* Supporting Files */, 99 | ); 100 | path = LionTableViewTesting; 101 | sourceTree = ""; 102 | }; 103 | 73002CE1140ABCF60035299A /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 73002CE2140ABCF60035299A /* LionTableViewTesting-Info.plist */, 107 | 73002CE3140ABCF60035299A /* InfoPlist.strings */, 108 | 73002CE6140ABCF60035299A /* main.m */, 109 | 73002CE8140ABCF60035299A /* LionTableViewTesting-Prefix.pch */, 110 | 73002CE9140ABCF60035299A /* Credits.rtf */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 73002CD5140ABCF60035299A /* LionTableViewTesting */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */; 121 | buildPhases = ( 122 | 73002CD2140ABCF60035299A /* Sources */, 123 | 73002CD3140ABCF60035299A /* Frameworks */, 124 | 73002CD4140ABCF60035299A /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = LionTableViewTesting; 131 | productName = LionTableViewTesting; 132 | productReference = 73002CD6140ABCF60035299A /* LionTableViewTesting.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | /* End PBXNativeTarget section */ 136 | 137 | /* Begin PBXProject section */ 138 | 73002CCD140ABCF60035299A /* Project object */ = { 139 | isa = PBXProject; 140 | buildConfigurationList = 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */; 141 | compatibilityVersion = "Xcode 3.2"; 142 | developmentRegion = English; 143 | hasScannedForEncodings = 0; 144 | knownRegions = ( 145 | en, 146 | ); 147 | mainGroup = 73002CCB140ABCF60035299A; 148 | productRefGroup = 73002CD7140ABCF60035299A /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 73002CD5140ABCF60035299A /* LionTableViewTesting */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 73002CD4140ABCF60035299A /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 73002CE5140ABCF60035299A /* InfoPlist.strings in Resources */, 163 | 73002CEB140ABCF60035299A /* Credits.rtf in Resources */, 164 | 73002CF1140ABCF60035299A /* MainMenu.xib in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 73002CD2140ABCF60035299A /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 73002CE7140ABCF60035299A /* main.m in Sources */, 176 | 73002CEE140ABCF60035299A /* LionTableViewTestingAppDelegate.m in Sources */, 177 | 73002CF9140AD6570035299A /* Item.m in Sources */, 178 | 73D521E7140B6DA400D98CC2 /* ItemCellView.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 73002CE3140ABCF60035299A /* InfoPlist.strings */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 73002CE4140ABCF60035299A /* en */, 189 | ); 190 | name = InfoPlist.strings; 191 | sourceTree = ""; 192 | }; 193 | 73002CE9140ABCF60035299A /* Credits.rtf */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 73002CEA140ABCF60035299A /* en */, 197 | ); 198 | name = Credits.rtf; 199 | sourceTree = ""; 200 | }; 201 | 73002CEF140ABCF60035299A /* MainMenu.xib */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 73002CF0140ABCF60035299A /* en */, 205 | ); 206 | name = MainMenu.xib; 207 | sourceTree = ""; 208 | }; 209 | /* End PBXVariantGroup section */ 210 | 211 | /* Begin XCBuildConfiguration section */ 212 | 73002CF2140ABCF60035299A /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 217 | COPY_PHASE_STRIP = NO; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 227 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | MACOSX_DEPLOYMENT_TARGET = 10.7; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = macosx; 235 | }; 236 | name = Debug; 237 | }; 238 | 73002CF3140ABCF60035299A /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 243 | COPY_PHASE_STRIP = YES; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | GCC_C_LANGUAGE_STANDARD = gnu99; 246 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 247 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | MACOSX_DEPLOYMENT_TARGET = 10.7; 253 | SDKROOT = macosx; 254 | }; 255 | name = Release; 256 | }; 257 | 73002CF5140ABCF60035299A /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 261 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 262 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | WRAPPER_EXTENSION = app; 265 | }; 266 | name = Debug; 267 | }; 268 | 73002CF6140ABCF60035299A /* Release */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 272 | GCC_PREFIX_HEADER = "LionTableViewTesting/LionTableViewTesting-Prefix.pch"; 273 | INFOPLIST_FILE = "LionTableViewTesting/LionTableViewTesting-Info.plist"; 274 | PRODUCT_NAME = "$(TARGET_NAME)"; 275 | WRAPPER_EXTENSION = app; 276 | }; 277 | name = Release; 278 | }; 279 | /* End XCBuildConfiguration section */ 280 | 281 | /* Begin XCConfigurationList section */ 282 | 73002CD0140ABCF60035299A /* Build configuration list for PBXProject "LionTableViewTesting" */ = { 283 | isa = XCConfigurationList; 284 | buildConfigurations = ( 285 | 73002CF2140ABCF60035299A /* Debug */, 286 | 73002CF3140ABCF60035299A /* Release */, 287 | ); 288 | defaultConfigurationIsVisible = 0; 289 | defaultConfigurationName = Release; 290 | }; 291 | 73002CF4140ABCF60035299A /* Build configuration list for PBXNativeTarget "LionTableViewTesting" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | 73002CF5140ABCF60035299A /* Debug */, 295 | 73002CF6140ABCF60035299A /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | /* End XCConfigurationList section */ 301 | }; 302 | rootObject = 73002CCD140ABCF60035299A /* Project object */; 303 | } 304 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // Item.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface Item : NSObject 10 | 11 | @property (nonatomic, copy) NSString *itemPath; 12 | @property (nonatomic, readonly) NSString *itemDisplayName; 13 | @property (nonatomic, readonly) NSString *itemKind; 14 | @property (nonatomic, readonly) NSImage *itemIcon; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/Item.m: -------------------------------------------------------------------------------- 1 | // 2 | // Item.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | 11 | @implementation Item 12 | 13 | @synthesize itemDisplayName = _itemDisplayName; 14 | @synthesize itemPath = _itemPath; 15 | @synthesize itemKind = _itemKind; 16 | @synthesize itemIcon = _itemIcon; 17 | 18 | - (void)dealloc { 19 | [_itemDisplayName release], _itemDisplayName = nil; 20 | [_itemPath release], _itemPath = nil; 21 | [_itemKind release], _itemKind = nil; 22 | [_itemIcon release], _itemIcon = nil; 23 | [super dealloc]; 24 | } 25 | 26 | - (NSString *)itemDisplayName { 27 | if (_itemDisplayName) return _itemDisplayName; 28 | _itemDisplayName = [[[NSFileManager defaultManager] displayNameAtPath:self.itemPath] retain]; 29 | return _itemDisplayName; 30 | } 31 | 32 | - (NSString *)itemKind { 33 | if (_itemKind) return _itemKind; 34 | if ([self.itemPath hasSuffix:@"app"]) 35 | _itemKind = @"Application"; 36 | else 37 | _itemKind = @"Folder"; 38 | return _itemKind; 39 | } 40 | 41 | - (NSImage *)itemIcon { 42 | if (_itemIcon) return _itemIcon; 43 | _itemIcon = [[[NSWorkspace sharedWorkspace] iconForFile:self.itemPath] retain]; 44 | return _itemIcon; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/ItemCellView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface ItemCellView : NSTableCellView 10 | 11 | - (void)layoutViewsForLargeSize:(BOOL)largeSize animated:(BOOL)animated; 12 | 13 | @property (nonatomic, retain) IBOutlet NSTextField *detailTextField; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/ItemCellView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemCellView.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/29/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ItemCellView.h" 10 | 11 | static BOOL kLargeSizeRequested = YES; 12 | 13 | #pragma mark - 14 | 15 | @implementation ItemCellView 16 | 17 | @synthesize detailTextField = _detailTextField; 18 | 19 | - (void)dealloc { 20 | [_detailTextField release], _detailTextField = nil; 21 | [super dealloc]; 22 | } 23 | 24 | - (void)setObjectValue:(id)objectValue { 25 | [super setObjectValue:objectValue]; 26 | [self layoutViewsForLargeSize:kLargeSizeRequested animated:NO]; 27 | } 28 | 29 | - (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle { 30 | NSColor *textColor = (backgroundStyle == NSBackgroundStyleDark) ? [NSColor windowBackgroundColor] : [NSColor controlShadowColor]; 31 | self.detailTextField.textColor = textColor; 32 | [super setBackgroundStyle:backgroundStyle]; 33 | } 34 | 35 | - (void)layoutViewsForLargeSize:(BOOL)largeSize animated:(BOOL)animated { 36 | kLargeSizeRequested = largeSize; 37 | 38 | // If large size is requested, we should show details text field otherwise hide it. 39 | CGFloat detailAlpha = largeSize ? 1.0f : 0.0f; 40 | 41 | // If large size is requested, we should use 32x32, otherwise 16x16 icon. 42 | CGFloat iconSize = largeSize ? 32.0f : 16.0f; 43 | NSRect iconFrame = NSMakeRect(2.0f, 2.0f, iconSize, iconSize); 44 | 45 | // We should always align name text field to the right of the icon. 46 | CGFloat nameLeft = iconFrame.origin.x + iconFrame.size.width + 5.0f; 47 | CGFloat nameBottom = iconFrame.origin.y + iconFrame.size.height - (largeSize ? 18.0f : 16.0f); 48 | CGFloat nameWidth = self.bounds.size.width - nameLeft - 2.0f; 49 | CGFloat nameHeight = 16.0f; 50 | NSRect nameFrame = NSMakeRect(nameLeft, nameBottom, nameWidth, nameHeight); 51 | 52 | if (animated) { 53 | [[self.detailTextField animator] setAlphaValue:detailAlpha]; 54 | [[self.imageView animator] setFrame:iconFrame]; 55 | [[self.textField animator] setFrame:nameFrame]; 56 | } else { 57 | [self.detailTextField setAlphaValue:detailAlpha]; 58 | [self.imageView setFrame:iconFrame]; 59 | [self.textField setFrame:nameFrame]; 60 | } 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/LionTableViewTesting-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.gentlebytes.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/LionTableViewTesting-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LionTableViewTesting' target in the 'LionTableViewTesting' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/LionTableViewTestingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.h 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @interface LionTableViewTestingAppDelegate : NSObject 10 | 11 | - (IBAction)itemsSizeClicked:(id)sender; 12 | 13 | @property (nonatomic, assign) IBOutlet NSTableView *tableView; 14 | @property (nonatomic, assign) IBOutlet NSWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/LionTableViewTestingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LionTableViewTestingAppDelegate.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Item.h" 10 | #import "ItemCellView.h" 11 | #import "LionTableViewTestingAppDelegate.h" 12 | 13 | @interface LionTableViewTestingAppDelegate () 14 | 15 | @property (nonatomic, readonly) NSArray *items; 16 | @property (nonatomic, assign) BOOL isLargeSizeRequested; 17 | 18 | @end 19 | 20 | #pragma mark - 21 | 22 | @implementation LionTableViewTestingAppDelegate 23 | 24 | @synthesize tableView = _tableView; 25 | @synthesize window = _window; 26 | @synthesize items = _items; 27 | @synthesize isLargeSizeRequested = _isLargeSizeRequested; 28 | 29 | - (id)init { 30 | self = [super init]; 31 | if (self) { 32 | _isLargeSizeRequested = YES; 33 | } 34 | return self; 35 | } 36 | 37 | #pragma mark - NSApplicationDelegate 38 | 39 | - (void)applicationDidFinishLaunching:(NSNotification *)note { 40 | // Nothing to do here for this simple app... 41 | } 42 | 43 | #pragma mark - NSTableViewDelegate 44 | 45 | - (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row { 46 | return self.isLargeSizeRequested ? 34.0f : 20.0f; 47 | } 48 | 49 | #pragma mark - User actions 50 | 51 | - (IBAction)itemsSizeClicked:(id)sender { 52 | // Get the state from the check box. We need to save it in a property, so that we can access it in table view delegate code. 53 | self.isLargeSizeRequested = ([sender state] == NSOnState); 54 | 55 | // Tell each cell view that it should change the size - this will make sure the cell view updates its contents accordingly. 56 | [self.tableView enumerateAvailableRowViewsUsingBlock:^(NSTableRowView *rowView, NSInteger row) { 57 | ItemCellView *cellView = [self.tableView viewAtColumn:0 row:row makeIfNecessary:NO]; 58 | [cellView layoutViewsForLargeSize:self.isLargeSizeRequested animated:YES]; 59 | }]; 60 | 61 | // Notify the table view about the rows which size just changed - all in our case. This will call our delegate method where we will return desired row size. 62 | NSRange changedRange = NSMakeRange(0, self.tableView.numberOfRows); 63 | NSIndexSet *changedIndexes = [NSIndexSet indexSetWithIndexesInRange:changedRange]; 64 | [self.tableView noteHeightOfRowsWithIndexesChanged:changedIndexes]; 65 | } 66 | 67 | #pragma mark - Login items 68 | 69 | - (NSArray *)items { 70 | if (_items) return _items; 71 | NSFileManager *manager = [NSFileManager defaultManager]; 72 | NSArray *contents = [manager contentsOfDirectoryAtPath:@"/Applications" error:nil]; 73 | NSMutableArray *items = [NSMutableArray arrayWithCapacity:[contents count]]; 74 | [contents enumerateObjectsUsingBlock:^(NSString *filename, NSUInteger idx, BOOL *stop) { 75 | if ([filename hasPrefix:@"."]) return; 76 | Item *item = [[[Item alloc] init] autorelease]; 77 | item.itemPath = [@"/Applications" stringByAppendingPathComponent:filename]; 78 | [items addObject:item]; 79 | }]; 80 | _items = [items retain]; 81 | return _items; 82 | } 83 | @end 84 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example5/LionTableViewTesting/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LionTableViewTesting 4 | // 5 | // Created by Tomaž Kragelj on 8/28/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /Readme.markdown: -------------------------------------------------------------------------------- 1 | About 2 | ----- 3 | 4 | Example projects demonstrating how OS X 10.7 Lion view-based table views are handled. 5 | 6 | This is companion code for two part blog post: 7 | 8 | * [Part 1 - basics](http://www.gentlebytes.com/2011/08/view-based-table-views-in-lion-part-1-of-2/) 9 | * [Part 2 - bindings and animations](http://www.gentlebytes.com/2011/08/view-based-table-views-in-lion-part-2-of-2/) 10 | 11 | The code is provided under MIT license as stated below. 12 | 13 | 14 | License 15 | ------- 16 | 17 | Copyright (C) 2011 by Tomaz Kragelj 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. --------------------------------------------------------------------------------