Skip to content

Commit

Permalink
Update for iOS 5, convert to ARC and LLDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Anderson committed Mar 8, 2012
1 parent 2669518 commit 8d31487
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 52 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DS_Store
*.swp
*~.nib

build/

*.pbxuser
*.perspective
*.perspectivev3

*.mode1v3
*.mode2v3
~$*

xcuserdata
10 changes: 8 additions & 2 deletions navPopover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
4F4A9FC8137CA85F00390C90 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
ORGANIZATIONNAME = "ElectroBarn Inc.";
};
buildConfigurationList = 4F4A9FCB137CA85F00390C90 /* Build configuration list for PBXProject "navPopover" */;
Expand Down Expand Up @@ -239,7 +240,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
Expand All @@ -254,7 +255,7 @@
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
Expand All @@ -268,10 +269,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "navPopover/navPopover-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "navPopover/navPopover-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
Expand All @@ -282,9 +285,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "navPopover/navPopover-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "navPopover/navPopover-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
VALIDATE_PRODUCT = YES;
Expand All @@ -311,6 +316,7 @@
4F4A9FF4137CA86000390C90 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion navPopover/EBAlternateSecondViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
UIPickerView *pickerView;
}
@property (nonatomic, assign) CGSize popoverContentSize;
@property (nonatomic, retain) IBOutlet UIPickerView *pickerView;
@property (nonatomic) IBOutlet UIPickerView *pickerView;

@end
7 changes: 1 addition & 6 deletions navPopover/EBAlternateSecondViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
return self;
}

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

- (void)didReceiveMemoryWarning
{
Expand Down Expand Up @@ -106,7 +101,7 @@ - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
return NSIntegerMax;
return 100;
}

#pragma mark - UIPickerViewDelegate
Expand Down
8 changes: 4 additions & 4 deletions navPopover/EBFirstViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
EBSecondViewController *secondViewController;
EBAlternateSecondViewController *alternateSecondViewController;
}
@property (nonatomic, retain) NSArray *selectionList;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic) NSArray *selectionList;
@property (nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, assign) CGSize popoverContentSize;
@property (nonatomic, retain) EBSecondViewController *secondViewController;
@property (nonatomic, retain) EBAlternateSecondViewController *alternateSecondViewController;
@property (nonatomic) EBSecondViewController *secondViewController;
@property (nonatomic) EBAlternateSecondViewController *alternateSecondViewController;

- (id)initWithArray:(NSArray *)array;

Expand Down
10 changes: 1 addition & 9 deletions navPopover/EBFirstViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
return self;
}

- (void)dealloc
{
[tableView release];
[selectionList release];
[secondViewController release];
[alternateSecondViewController release];
[super dealloc];
}

- (void)didReceiveMemoryWarning
{
Expand Down Expand Up @@ -140,7 +132,7 @@ - (UITableViewCell *)tableView:(UITableView *)targetTableView cellForRowAtIndexP

UITableViewCell *cell = [targetTableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:cellIdentifier] autorelease];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = [self.selectionList objectAtIndex:indexPath.row];

Expand Down
2 changes: 1 addition & 1 deletion navPopover/EBSecondViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
NSArray *selectionList;
CGSize popoverContentSize;
}
@property (nonatomic, retain) NSArray *selectionList;
@property (nonatomic) NSArray *selectionList;
@property (nonatomic, assign) CGSize popoverContentSize;

- (id)initWithArray:(NSArray *)array;
Expand Down
7 changes: 1 addition & 6 deletions navPopover/EBSecondViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
return self;
}

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

- (void)didReceiveMemoryWarning
{
Expand Down Expand Up @@ -99,7 +94,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:cellIdentifier] autorelease];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = [self.selectionList objectAtIndex:indexPath.row];

Expand Down
8 changes: 4 additions & 4 deletions navPopover/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

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

}

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

@property (nonatomic, retain) IBOutlet navPopoverViewController *viewController;
@property (nonatomic) IBOutlet navPopoverViewController *viewController;

@end
6 changes: 0 additions & 6 deletions navPopover/navPopoverAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,5 @@ - (void)applicationWillTerminate:(UIApplication *)application
*/
}

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

@end
4 changes: 2 additions & 2 deletions navPopover/navPopoverViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
UIButton *showPopoverButton;
UIPopoverController *popoverController;
}
@property (nonatomic, retain) IBOutlet UIButton *showPopoverButton;
@property (nonatomic, retain) IBOutlet UIPopoverController *popoverController;
@property (nonatomic) IBOutlet UIButton *showPopoverButton;
@property (nonatomic) IBOutlet UIPopoverController *popoverController;

- (IBAction)showNavPopover:(id)sender;

Expand Down
10 changes: 1 addition & 9 deletions navPopover/navPopoverViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ @implementation navPopoverViewController
@synthesize showPopoverButton;
@synthesize popoverController;

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

- (void)didReceiveMemoryWarning
{
Expand Down Expand Up @@ -60,9 +55,8 @@ - (IBAction)showNavPopover:(id)sender {
EBFirstViewController *firstViewController = [[EBFirstViewController alloc] initWithArray:[NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", @"Five", @"Six", @"Seven", @"Eight", @"Nine", @"Ten", @"One", @"Two", @"Three", @"Four", @"Five", @"Six", @"Seven", @"Eight", @"Nine", @"Ten", nil]];

// stick it in a navigation controller
UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:firstViewController] autorelease];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
navigationController.delegate = self;
[firstViewController release];

// show the navigation controller in a popover
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:navigationController];
Expand All @@ -71,8 +65,6 @@ - (IBAction)showNavPopover:(id)sender {

[popoverController presentPopoverFromRect:self.showPopoverButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

[popover release];
[navigationController release];

}

Expand Down

0 comments on commit 8d31487

Please sign in to comment.