IPhone Dev Notes - 4 - 多视图程序


//

//  test09AppDelegate.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>


@interface test09AppDelegate :NSObject <UIApplicationDelegate>{

    UITabBarController *rootController;

}


@property (nonatomic,retain)IBOutletUIWindow *window;

@property (nonatomic,retain)IBOutletUITabBarController *rootController;



@end

//

//  test09AppDelegate.m

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import"test09AppDelegate.h"


@implementation test09AppDelegate



@synthesize window=_window;

@synthesize rootController;


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

   // Override point for customization after application launch.

    [self.windowaddSubview:rootController.view];

    [self.windowmakeKeyAndVisible];

   returnYES;

}


- (void)applicationWillResignActive:(UIApplication *)application

{

    /*

     Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

     Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.

     */

}


- (void)applicationDidEnterBackground:(UIApplication *)application

{

    /*

     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 

     If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

     */

}


- (void)applicationWillEnterForeground:(UIApplication *)application

{

    /*

     Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

     */

}


- (void)applicationDidBecomeActive:(UIApplication *)application

{

    /*

     Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

     */

}


- (void)applicationWillTerminate:(UIApplication *)application

{

    /*

     Called when the application is about to terminate.

     Save data if appropriate.

     See also applicationDidEnterBackground:.

     */

}


- (void)dealloc

{

    [rootControllerrelease];

    [_windowrelease];

    [superdealloc];

}


@end


//

//  DatePickerViewController.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>



@interface DatePickerViewController :UIViewController {

    UIDatePicker *dataPicker;

    

}


@property (nonatomic,retain)IBOutletUIDatePicker *dataPicker;


- (IBAction)buttonPressed;


@end


//

//  DatePickerViewController.m

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import"DatePickerViewController.h"


@implementation DatePickerViewController


@synthesize dataPicker;


- (IBAction)buttonPressed{

    NSDate *selected = [dataPicker date];

   NSString *message = [[NSStringalloc]initWithFormat:@"The date and time you selected is: %@", selected];

   UIAlertView *alert = [[UIAlertViewalloc

                         initWithTitle:@"Date and Time Selected" 

                         message:messagedelegate:nilcancelButtonTitle:@"Yes, I did."otherButtonTitles:nil];

    [alert show];

    [alert release];

    [message release];

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

       // Custom initialization

    }

   returnself;

}


- (void)dealloc

{

    [dataPickerrelease];

    [superdealloc];

}


- (void)didReceiveMemoryWarning

{

   // Releases the view if it doesn't have a superview.

    [superdidReceiveMemoryWarning];

    

   // Release any cached data, images, etc that aren't in use.

    NSDate *now = [[NSDate alloc] init];

    [dataPickersetDate:nowanimated:NO];

    [now release];

}


#pragma mark - View lifecycle


- (void)viewDidLoad

{

    [superviewDidLoad];

   // Do any additional setup after loading the view from its nib.

}


- (void)viewDidUnload

{    

    [superviewDidUnload];

   dataPicker =nil;

   // Release any retained subviews of the main view.

   // e.g. self.myOutlet = nil;

}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

   // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}


@end


//

//  SingleComponentPickerViewController.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>



@interface SingleComponentPickerViewController :UIViewController <UIPickerViewDelegate,UIPickerViewDataSource>{

    UIPickerView *singlesPicker;

    NSArray *pickerData;    

}


@property (nonatomic,retain)IBOutletUIPickerView *singlePicker;

@property (nonatomic,retain)NSArray *pickerData;


- (IBAction)buttonPressed;


@end


//

//  SingleComponentPickerViewController.m

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import"SingleComponentPickerViewController.h"



@implementation SingleComponentPickerViewController


@synthesize singlePicker;

@synthesize pickerData;


- (IBAction)buttonPressed{

   NSInteger row = [singlePickerselectedRowInComponent:0];

    NSString *selected = [pickerData objectAtIndex:row];

    NSString *title = [[NSString alloc] initWithFormat:@"You selected %@!", selected];

   UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:titlemessage:@"Thank you for choosing"delegate:nilcancelButtonTitle:@"You're Welcome"otherButtonTitles:nil];

    [alert show];

    [alert release];

    [title release];

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

       // Custom initialization

    }

   returnself;

}


- (void)dealloc

{

    [singlePickerrelease];

    [pickerDatarelease];

    [superdealloc];

}


- (void)didReceiveMemoryWarning

{

   // Releases the view if it doesn't have a superview.

    [superdidReceiveMemoryWarning];

    

   // Release any cached data, images, etc that aren't in use.

}


#pragma mark - View lifecycle


- (void)viewDidLoad

{

    [superviewDidLoad];

   // Do any additional setup after loading the view from its nib.

   NSArray *array = [[NSArrayalloc]initWithObjects:@"Luke",@"Leia",@"Han",@"Chewbacca",@"Artoo",@"Threepio",@"Lando",nil];

    self.pickerData = array;

    [array release];

}


- (void)viewDidUnload

{

    [superviewDidUnload];

   // Release any retained subviews of the main view.

   // e.g. self.myOutlet = nil;

   self.singlePicker =nil;

   self.pickerData =nil;

}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

   // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}


#pragma mark -

#pragma mark Picker Data Source Methods


- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{

    return 1;

}


- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{

   return [pickerDatacount];

}


#pragma  mark Picker Delegate Methods

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{

    return [pickerData objectAtIndex:row];


@end


//

//  DoubleComponentPickerViewController.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>


#define kFillingComponent0

#define kBreadComponnet1


@interface DoubleComponentPickerViewController :UIViewController <UIPickerViewDelegate,UIPickerViewDataSource>{

    UIPickerView *doublePicker;

    NSArray *fillingTypes;

    NSArray *breadTypes;

}


@property (nonatomic,retain)IBOutletUIPickerView *doublePicker;

@property (nonatomic,retain)NSArray *fillingTypes;

@property (nonatomic,retain)NSArray *breadTypes;


- (IBAction)buttonPressed;


@end


//

//  DoubleComponentPickerViewController.m

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import"DoubleComponentPickerViewController.h"



@implementation DoubleComponentPickerViewController


@synthesize doublePicker;

@synthesize fillingTypes;

@synthesize breadTypes;


- (IBAction)buttonPressed{

    NSInteger fillingRow = [doublePicker selectedRowInComponent:kFillingComponent];

   NSInteger breadRow = [doublePickerselectedRowInComponent:kBreadComponnet];

    NSString *bread = [breadTypes objectAtIndex:breadRow];

    NSString *filling = [fillingTypes objectAtIndex:fillingRow];

    NSString *message = [[NSString alloc] initWithFormat:@"Your %@ on %@ bread will be right up.", filling, bread];

   UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:@"Thank you for your order"message:messagedelegate:nilcancelButtonTitle:@"Great!"otherButtonTitles:nil];

    [alert show];

    [alert release];

    [message release];

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

       // Custom initialization

    }

   returnself;

}


- (void)dealloc

{

    [doublePickerrelease];

    [fillingTypesrelease];

    [breadTypesrelease];

    [superdealloc];

}


- (void)didReceiveMemoryWarning

{

   // Releases the view if it doesn't have a superview.

    [superdidReceiveMemoryWarning];

    

   // Release any cached data, images, etc that aren't in use.

}


#pragma mark - View lifecycle


- (void)viewDidLoad

{

    [superviewDidLoad];

   // Do any additional setup after loading the view from its nib.

   NSArray *fillingArray = [[NSArrayalloc]initWithObjects:@"Ham",@"Turkey",@"Peanut Butter",@"Tuna Salad",@"Nutella",@"Roast Beef",@"Vegemite",nil];

    self.fillingTypes = fillingArray;

    [fillingArray release];

    

   NSArray *breadArray = [[NSArrayalloc]initWithObjects:@"White",@"Whole Wheat",@"Rye",@"Sourdough",@"Seven Grain",nil];

    self.breadTypes = breadArray;

    [breadArray release];

    

}


- (void)viewDidUnload

{

    [superviewDidUnload];

   // Release any retained subviews of the main view.

   // e.g. self.myOutlet = nil;

   doublePicker =nil;

    fillingTypes = nil;    

   breadTypes =nil;

}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

   // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}


#pragma mark -

#pragma mark Picker Data Source Methods

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{

    return 2;

}


- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{

    if(component == kBreadComponnet)

        return [self.breadTypescount];

   return [self.fillingTypescount];

}


#pragma mark -

#pragma mark Picker Delegate Methods

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{

    if (component == kBreadComponnet)

        return [self.breadTypesobjectAtIndex:row];

    return [self.fillingTypesobjectAtIndex:row];

}


@end


//

//  DependentComponnetPickerViewController.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>


#define kStateComponent0

#define kZipComponent1


@interface DependentComponnetPickerViewController :UIViewController <UIPickerViewDelegate,UIPickerViewDataSource>{

    UIPickerView *picker;

    

    NSDictionary *stateZips;

    NSArray *states;

    NSArray *zips;

}


@property (nonatomic,retain)IBOutletUIPickerView *picker;

@property (nonatomic,retain)NSDictionary *stateZips;

@property (nonatomic,retain)NSArray *states;

@property (nonatomic,retain)NSArray *zips;


- (IBAction)buttonPressed;


@end


 

//

//  DependentComponnetPickerViewController.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>


#define kStateComponent0

#define kZipComponent1


@interface DependentComponnetPickerViewController :UIViewController <UIPickerViewDelegate,UIPickerViewDataSource>{

    UIPickerView *picker;

    

    NSDictionary *stateZips;

    NSArray *states;

    NSArray *zips;

}


@property (nonatomic,retain) IBOutletUIPickerView *picker;

@property (nonatomic,retain) NSDictionary *stateZips;

@property (nonatomic,retain) NSArray *states;

@property (nonatomic,retain) NSArray *zips;


- (IBAction)buttonPressed;


@end


//

//  DependentComponnetPickerViewController.m

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import"DependentComponentPickerViewController.h"



@implementation DependentComponnetPickerViewController


@synthesize picker;

@synthesize stateZips;

@synthesize states;

@synthesize zips;


- (IBAction)buttonPressed{

   NSInteger stateRow = [pickerselectedRowInComponent:kStateComponent];

   NSInteger zipRow = [pickerselectedRowInComponent:kZipComponent];

    

    NSString *state = [self.statesobjectAtIndex:stateRow];

    NSString *zip = [self.zipsobjectAtIndex:zipRow];

    

   NSString *title = [[NSStringalloc] initWithFormat:@"You selected zip code %@.",zip];

    NSString *message = [[NSString alloc] initWithFormat:@"%@ is in %@", zip, state];

    

   UIAlertView *alert = [[UIAlertViewalloc] initWithTitle:titlemessage:message delegate:nilcancelButtonTitle:@"OK"otherButtonTitles: nil];

    

    [alert show];

    [alert release];

    [title release];

    [message release];

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

       // Custom initialization

    }

   return self;

}


- (void)dealloc

{

    [pickerrelease];

    [stateZipsrelease];

    [statesrelease];

    [zipsrelease];

    [superdealloc];

}


- (void)didReceiveMemoryWarning

{

   // Releases the view if it doesn't have a superview.

    [superdidReceiveMemoryWarning];    

   // Release any cached data, images, etc that aren't in use.

}


#pragma mark - View lifecycle


- (void)viewDidLoad

{

    [superviewDidLoad];

   // Do any additional setup after loading the view from its nib.

    NSBundle *bundle = [NSBundle mainBundle];

    NSString *plistPath = [bundle pathForResource:@"statedictionary"ofType:@"plist"];

    

    NSDictionary *dictionary = [[NSDictionaryalloc] initWithContentsOfFile:plistPath];

    self.stateZips = dictionary;

    [dictionary release];

    

    NSArray *components = [self.stateZipsallKeys];

    NSArray *sorted = [components sortedArrayUsingSelector:@selector(compare:)];

    self.states = sorted;

    

    NSString *selectedState = [self.statesobjectAtIndex:0];

    NSArray *array = [stateZips objectForKey:selectedState];

    self.zips = array;

}


- (void)viewDidUnload

{

    [superviewDidUnload];

   // Release any retained subviews of the main view.

   // e.g. self.myOutlet = nil;

   stateZips = nil;

    states = nil;

    zips = nil;

    picker = nil;

}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

   // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}


#pragma mark -

#pragma mark Picker Data Source Methods

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{

    return 2;

}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{

    if(component == kStateComponent)

        return [self.statescount];

    return [self.zipscount];

}


#pragma mark =

#pragma mark Picker Delegate Methods

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{

    if(component == kStateComponent)

        return [self.statesobjectAtIndex:row];

    return [self.zipsobjectAtIndex:row];

}


- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{

    if (component == kStateComponent) {

        NSString *selectedState = [self.statesobjectAtIndex:row];

        NSArray *array = [stateZips objectForKey:selectedState];

        self.zips = array;

        [pickerselectRow:0inComponent:kZipComponentanimated:YES];

        [pickerreloadComponent:kZipComponent];

    }

}


- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component{

    if(component == kZipComponent)

        return 90;

    return 200;

}


@end


//

//  CustomPickerViewController.h

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import<UIKit/UIKit.h>

#import<AudioToolbox/AudioToolbox.h>



@interface CustomPickerViewController :UIViewController <UIPickerViewDataSource,UIPickerViewDelegate>{

    UIPickerView *picker;

    UILabel *winLable;

    

    NSArray *column1;

    NSArray *column2;

    NSArray *column3;

    NSArray *column4;

    NSArray *column5;    

    

    UIButton *button;

    SystemSoundID crunchSoundID;

    SystemSoundID winSoundID;

}


@property (nonatomic,retain) IBOutletUIPickerView *picker;

@property (nonatomic,retain) IBOutletUILabel *winLable;

@property (nonatomic,retain) NSArray *column1;

@property (nonatomic,retain) NSArray *column2;

@property (nonatomic,retain) NSArray *column3;

@property (nonatomic,retain) NSArray *column4;

@property (nonatomic,retain) NSArray *column5;

@property (nonatomic,retain) IBOutletUIButton *button;

@property (nonatomic)SystemSoundID crunchSoundID;

@property (nonatomic)SystemSoundID winSoundID;


- (IBAction)spin;


@end


//

//  CustomPickerViewController.m

//  test09

//

//  Created by lily bear on 12-2-6.

//  Copyright 2012 lily. All rights reserved.

//


#import"CustomPickerViewController.h"



@implementation CustomPickerViewController


@synthesize picker;

@synthesize winLable;

@synthesize column1;

@synthesize column2;

@synthesize column3;

@synthesize column4;

@synthesize column5;

@synthesize button;

@synthesize crunchSoundID;

@synthesize winSoundID;


- (IBAction)spin{

    BOOL win = NO;

    int numInRow = 1;

    int lastVal = -1;

    for (int i = 0; i < 5; i++){

        int newValue = random() % [self.column1count];

        

        if (newValue == lastVal)

            numInRow++;

        else

            numInRow =1;

        

        lastVal = newValue;

        [pickerselectRow:newValue inComponent:ianimated:YES];

        [pickerreloadComponent:i];

        if(numInRow >= 3)

            win = YES;

    }

    

    button.hidden = YES;

   AudioServicesPlaySystemSound(crunchSoundID);

    

    if(win)

        [selfperformSelector:@selector(playWinSound)withObject:nilafterDelay:.5];

    else

        [selfperformSelector:@selector(showButton)withObject:nilafterDelay:.5];

    

    winLable.text = @"";

}


- (void)showButton{

    button.hidden = NO;

}


- (void)playWinSound{

   AudioServicesPlaySystemSound(winSoundID);

    winLable.text = @"WIN!";

    [selfperformSelector:@selector(showButton)withObject:nilafterDelay:1.5];

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

       // Custom initialization

    }

   return self;

}


- (void)dealloc

{

    [pickerrelease];

    [winLablerelease];

    [column1release];

    [column2release];

    [column3release];

    [column4release];

    [column5release];

    [buttonrelease];

    

   if(winSoundID)

       AudioServicesDisposeSystemSoundID(winSoundID),winSoundID =0;

   if(crunchSoundID)

       AudioServicesDisposeSystemSoundID(crunchSoundID),crunchSoundID =0;    

    

    [superdealloc];    

}


- (void)didReceiveMemoryWarning

{

   // Releases the view if it doesn't have a superview.

    [superdidReceiveMemoryWarning];

    

   // Release any cached data, images, etc that aren't in use.

}


#pragma mark - View lifecycle


- (void)viewDidLoad

{

    [superviewDidLoad];

   // Do any additional setup after loading the view from its nib.

    UIImage *seven = [UIImage imageNamed:@"seven.png"];

    UIImage *bar = [UIImage imageNamed:@"bar.png"];

    UIImage *crown = [UIImage imageNamed:@"crown.png"];

    UIImage *cherry = [UIImage imageNamed:@"cherry.png"];

    UIImage *lemon = [UIImage imageNamed:@"lemon.png"];

    UIImage *apple = [UIImage imageNamed:@"apple.png"];

    

    for(int i=1; i<=5;i++){

        UIImageView *sevenView = [[UIImageView alloc] initWithImage:seven];

        UIImageView *barView = [[UIImageView alloc] initWithImage:bar];

        UIImageView *crownView = [[UIImageView alloc] initWithImage:crown];

        UIImageView *cherryView = [[UIImageViewalloc] initWithImage:cherry];

        UIImageView *lemonView = [[UIImageView alloc] initWithImage:lemon];

        UIImageView *appleView = [[UIImageView alloc] initWithImage:apple];

        NSArray *imageViewArray = [[NSArray alloc] initWithObjects:sevenView,barView,crownView,cherryView,lemonView,appleView,nil];

        NSString *fieldName = [[NSString alloc] initWithFormat:@"column%d", i];

        [selfsetValue:imageViewArray forKey:fieldName];

        [fieldName release];

        [imageViewArrayrelease];

        

        [sevenView release];

        [barView release];

        [crownView release];

        [cherryView release];

        [lemonView release];

        [appleView release];

    }

    

   NSString *path = [[NSBundlemainBundle] pathForResource:@"win"ofType:@"wav"];

   AudioServicesCreateSystemSoundID((CFURLRef)[NSURLfileURLWithPath:path], &winSoundID);

    path = [[NSBundlemainBundle] pathForResource:@"crunch"ofType:@"wav"];

   AudioServicesCreateSystemSoundID((CFURLRef)[NSURLfileURLWithPath:path], &crunchSoundID);

    

   srandom(time(NULL));

}


- (void)viewDidUnload

{

    [superviewDidUnload];

   // Release any retained subviews of the main view.

   // e.g. self.myOutlet = nil;

    self.picker = nil;

    self.winLable = nil;

    self.column1 = nil;

    self.column2 = nil;

    self.column3 = nil;

    self.column4 = nil;

    self.column5 = nil;

    self.button = nil;

    

   if(winSoundID)

       AudioServicesDisposeSystemSoundID(winSoundID),winSoundID =0;

   if(crunchSoundID)

       AudioServicesDisposeSystemSoundID(crunchSoundID),crunchSoundID =0;

}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

   // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}


#pragma mark -

#pragma mark Picker Data Source Methods

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{

    return 5;

}


- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{

    return [self.column1count];

}


#pragma mark -

#pragma mark Picker Delegate Methods

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{

    NSString *arrayName = [[NSString alloc] initWithFormat:@"column%d", component+1];

    NSArray *array = [self valueForKey:arrayName];

    [arrayName release];

    return [array objectAtIndex:row];

}


@end




[to be continued]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ava实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),可运行高分资源 Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现的毕业设计&&课程设计(包含运行文档+数据库+前后端代码),Java实现

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值