Ui Picker view error cant resolve - ios5

Still trying to figure out the UI picker view, 2 days on it now and for some reason im just stuck on this. Any advice please on what im doing wrong. Ive got a yellow triangle saying "Incomplete implementation" and a red triangle saying "Use of undeclared identifier numberOfComponentsinPickerView"
.h
#import <UIKit/UIKit.h>
#interface pick3 : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate> {
UIPickerView *select;
NSArray *list;
}
#property (strong, nonatomic) IBOutlet UIPickerView *select;
#end
.m
#import "pick3.h"
#interface pick3 ()
#end
#implementation pick3
#synthesize select;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
{
list = [[NSArray alloc] initWithObjects:#"Employed", #"Student", #"Retired", #"Homemaker", #"Self-employed", #"Unemployed", #"Other", nil];
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
//One column
return 1;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
//set number of rows
return list.count;
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
//set item per row
return [list objectAtIndex:row];
}
}

It's just a typo on your viewDidLoad: method.
You have an extra '{' before your 'list' and and extra '}' at the end of the file. Just remove them and you'll be ok.
Try this:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
list = [[NSArray alloc] initWithObjects:#"Employed", #"Student", #"Retired", #"Homemaker", #"Self-employed", #"Unemployed", #"Other", nil];
}

Related

collectionview with swipe in view controller

I'm doing a simple image gallery with a collectionview listing my images. Images names are stocked into an array. When I press on an image, it display the picture in a view controller with an imageview.
Now I would like to be able to switch from one image to the next and previous image with a swipe instead of going back to the collection view to change picture. Did I choose a wrong way to achieve my project or is there an easy way to do this?
Thank you already for your help!
Nicolas.
Here's my actual code :
PhotosCollectionViewController.h
import
#interface PhotosCollectionViewController : UICollectionViewController
{
NSArray *photosArray;
}
#end
PhotosCollectionViewController.m
#import "PhotosCollectionViewController.h"
#import "PhotoDetailViewController.h"
#interface PhotosCollectionViewController ()
#end
#implementation PhotosCollectionViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
photosArray = [NSArray arrayWithObjects:#"angry_birds_cake.jpg", #"creme_brelee.jpg", #"egg_benedict.jpg", #"full_breakfast.jpg", #"green_tea.jpg", #"ham_and_cheese_panini.jpg", #"ham_and_egg_sandwich.jpg", #"hamburger.jpg", #"instant_noodle_with_egg.jpg", #"japanese_noodle_with_pork.jpg", #"mushroom_risotto.jpg", #"noodle_with_bbq_pork.jpg", #"starbucks_coffee.jpg", #"thai_shrimp_cake.jpg", #"vegetable_curry.jpg", #"white_chocolate_donut.jpg", nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return photosArray.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = #"Cell";
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
UIImageView *photosImageView = (UIImageView *)[cell viewWithTag:100];
photosImageView.image = [UIImage imageNamed:[photosArray objectAtIndex:indexPath.row]];
return cell;
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:#"pushPhoto"]) {
NSArray *indexPaths = [self.collectionView indexPathsForSelectedItems];
PhotoDetailViewController *destViewController = segue.destinationViewController;
NSIndexPath *indexPath = [indexPaths objectAtIndex:0];
destViewController.photoName = [photosArray objectAtIndex:indexPath.row];
}
}
#end
PhotoDetailViewController.h
#import <UIKit/UIKit.h>
#interface PhotoDetailViewController : UIViewController
#property (strong, nonatomic) IBOutlet UIImageView *photoImageView;
#property (weak, nonatomic) NSString *photoName;
#end
PhotoDetailViewController.m
#import "PhotoDetailViewController.h"
#interface PhotoDetailViewController ()
#end
#implementation PhotoDetailViewController
#synthesize photoImageView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.photoImageView.image = [UIImage imageNamed:self.photoName];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
Just enable user interaction for your UIImageView, attach a UISwipeGestureRecognizer with the direction configured to how you want, and change the image in the UIImageView in the selector you've set in the gesture recogniser.
You are doing it right.Pass the array of images(or urls) and on the next and previous button action(or gesture recogonizer) , load the images from the array and show in the viewcontroller.
Create an array instance "imageArray" in the DetailsedImageVC class
stackedImages be the array in which the images are available
DetailedImageVC *vc=[[DetailedImageVC alloc]initWithNibName:#"DetailedImageVC" bundle:[NSBundle mainBundle]];
vc.imageArray=self.stackedImages ;
[self.navigationController pushViewController:vc animated:YES];
Now you have the array in DetailedImageVC and now on,when the next image needed action just get the image from the array nd load

UIPickerView wont display data properly

I am trying to make a UIPickerView with data #"0", #"1", #"2", #"3"... display on rows,
it will be a 2 columns pickerView.
here is my code:
this is .h file
#import <UIKit/UIKit.h>
#interface CustomNumberViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>
#property (strong, nonatomic) IBOutlet UIPickerView *numberPicker;
#property(strong, nonatomic)NSArray *listOfNumbers;
#property (strong,nonatomic)NSString *numberOfFirstColumn;
#property(strong,nonatomic)NSString *numberOfSecondColumn;
#end
this is .m file
#import "CustomNumberViewController.h"
#interface CustomNumberViewController ()
#end
#implementation CustomNumberViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
//UIView background
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:#"pickerbackground.png"] drawInRect:self.view.bounds];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
//init picker
self.numberPicker.showsSelectionIndicator = TRUE;
self.listOfNumbers = [[NSArray alloc] initWithObjects:#"0",#"1",#"2",#"3",nil];
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//Number of rows to display in each component
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
if (component==0) {
return [self.listOfNumbers count];
}
return [self.listOfNumbers count];
}
//Number of columns to display
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
//define what to display in each rows and columns
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
if (component==0) {
return [self.listOfNumbers objectAtIndex:row];
}
return [self.listOfNumbers objectAtIndex:row];
}
//selected number to be stored in nsstring
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if (component==0) {
self.numberOfFirstColumn = [self.listOfNumbers objectAtIndex:row];
}
self.numberOfSecondColumn = [self.listOfNumbers objectAtIndex:row];
}
#end
My problem is if I try to run the app, the UIPickerView isn't filled with any data... so absolutely empty....
and if i try to scull the 'selected indicator', app will crash at once...
this is the error msg ->
Assertion failure in -[UITableViewRowData rectForRow:inSection:], /SourceCache/UIKit_Sim/UIKit-2380.17/UITableViewRowData.m:1630
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect at invalid index path ( 2 indexes [0, 0])'
any suggestions ? thanks
It looks like you are not creating your UIPickerView in code. Did you make sure that the delegate and data source of the picker is the class you are trying to create it in? If it is not, it will not know what you want to have in it.

UITextView.text lags when loading text

I want to display text with an UITextView, which is part of an UITabBarView and do so in the following Class:
.h - File:
#import <UIKit/UIKit.h>
#interface DescriptionViewController : UIViewController{
IBOutlet UITextView *descriptionText;
}
#end
.m - File:
#import "DescriptionViewController.h"
#import "Globals.h"
#interface DescriptionViewController ()
#end
#implementation DescriptionViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
-(void) viewWillAppear:(BOOL)animated{
Globals* myGlobals = [Globals sharedGlobals];
descriptionText.text = [myGlobals.currentLine objectAtIndex:5];
}
#end
When the TextView is displayed the first time it is empty, when i switch to another tab and switch back to the "TextView - Tab" it is displayed properly. But I obviously want it to be displayed correctly the first time..
I already tried to move the relevant code to the -viewDidLoad function, but nothing changed. Also, I tried the -setNeedsDisplay function without success (maybe I used it wrong? - [descriptionText setNeedsDisplay].
I appreciate any help and further code will be posted on request.
Please set breakpoint on ViewWillAppear Method of your class then check that in first time what you are getting from NSLog("%#", [myGlobals.currentLine objectAtIndex:5]);
and you are missing [super viewWillAppear:animated];
try this,
- (void)viewDidLoad
{
[super viewDidLoad];
Globals* myGlobals = [Globals sharedGlobals];
descriptionText.text = [myGlobals.currentLine objectAtIndex:5];
}
-(void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
Globals* myGlobals = [Globals sharedGlobals];
descriptionText.text = [myGlobals.currentLine objectAtIndex:5];
}

iOs5, Trying to understand the UIPickerView and how to connect it to my custom class

Ok I am trying to connect a UIPickerView with a custom class. The idea is to have 3 picker views in one normal view.
So far I have created one view and bound it to my class TestView.h
Then I added a picker view to the view in the storyboard (iOS 5)
I then created a class for this picker view:
#interface TestPickerView : UIPickerView <UIPickerViewDelegate, UIPickerViewDataSource>
{
NSArray *data;
}
Then tried to add a Property to my normal view (TestView.h)
#import "TestPickerView.h"
#interface TestView : UIViewController
#property (strong, nonatomic) IBOutlet TestPickerView *myTestPicker;
#end
But how do i bind the UIPickerView inside my normal view to this class/property?
I will in the end have 3 UIPickerView's and my idea was to have 3 references in my UIViewController to control these UIPickerViews. That way I could set the data (datasource) using the properties once when the normal view is loading and then the PickerViews would just show. Hopefully i would also be able to get notified in my normal view when the value in one of the views occur.
Please call your TestView >> TestViewController instead, as it is a controller.
In your storyboard, select the PickerView and change it's class name to TestPickerView.
After that just create your three IBOutlets and connect the PickerViews. That's it.
// edit: To explain, how you distinguish between the pickers. Make 3 outlets, e.g.:
IBOutlet TestPickerView *picker1;
IBOutlet TestPickerView *picker2;
IBOutlet TestPickerView *picker3;
And than in your delegate method, check which picker did call the delegate, e.g.:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if(pickerView == self.picker1)
{
// picker1
}
else if(pickerView == self.picker2)
{
// picker2
}
else
{
// picker3
}
}
Here you go dude, this is how I did it on several of my apps and games.
#import <UIKit/UIKit.h>
#pragma mark - Delegate Protocol
#protocol someDelegate
#required
-(void)somePickerFinishedPicking:(id)item;
#end
#pragma mark - Class interface
#interface SomePicker : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource>
{
NSMutableArray* dataSource;
}
#pragma mark - Property Istantiation
#property (nonatomic, retain) NSMutableArray* dataSource;
#property (nonatomic, retain) id <someDelegate> pickDelegate;
#pragma mark - Constructors / Destructors
- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
- (void) didReceiveMemoryWarning;
- (void) dealloc;
- (void) createDataSource;
#pragma mark - View Lifecycle
- (void) viewDidLoad;
#pragma mark - UIPicker Protocols
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
-(UIView*) pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view;
#pragma mark - Delegate Protocols
-(void) handlePickerDidFinish:(id)item;
#end
this for your .m
#pragma mark - Class Implementation
#implementation SomePicker
#pragma mark - Variable synthesize
// ARRAYS
#synthesize dataSource;
// DELEGATES
#synthesize pickDelegate = _pickDelegate;
#pragma mark - Constructors / Deconstructors
// Class initialization
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
dataSource = [[NSMutableArray alloc] init];
[self createDataSource];
}
return self;
}
// Handles memory warning events
- (void)didReceiveMemoryWarning
{
// Release the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
// Garbage Collection
- (void) dealloc;
{
// Release what you need
self.dataSource = nil;
[super dealloc];
}
// Creates the occasion entries for the picker
-(void)createDataSource
{
NSMutableDictionary* dataDictionary = [[NSMutableDictionary alloc] init];
// create your data source here or just forget about this and pass it from the parentViewController.
[dataDictionary release];
}
#pragma mark - View lifecycle
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad;
{
[super viewDidLoad];
UIPickerView* occasionsPicker = [[UIPickerView alloc] init];
[occasionsPicker setDataSource:self];
[occasionsPicker setDelegate:self];
[occasionsPicker setTag:888];
[occasionsPicker selectRow:500 inComponent:0 animated:YES];
[self.view addSubview:occasionsPicker];
[occasionsPicker release];
[self handlePickerDidFinish:[[self.dataSource objectAtIndex:(500 % self.dataSource.count)] objectForKey:#"key"]];
}
#pragma mark - UIPicker Protocols
// Creates the rows in the picker.
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
// Endless roll illusion else just bind it to the size of the data source
return 1000;
}
// Determines the number of columns in the picker
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
// Add however many columns you need
return 1;
}
// Handles the event when the user picks a row.
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
//this does something with the row selected
[self handlePickerDidFinish:[[self.dataSource objectAtIndex:(row % self.dataSource.count)] objectForKey:#"key"]];
}
// Creates the custom view for each cell so the text shows in accordance to the App Style
-(UIView*) pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel* customRowLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, [pickerView rowSizeForComponent:component].width, [pickerView rowSizeForComponent:component].height)] autorelease];
customRowLabel.font = [UIFont fontWithName:#"HelveticaNeue" size: 16];
customRowLabel.textColor = [UIColor colorWithRed:kColorRed green:kColorGreen blue:kColorBlue alpha:1];
customRowLabel.textAlignment = UITextAlignmentCenter;
customRowLabel.backgroundColor = [UIColor clearColor];
customRowLabel.text = [[self.dataSource objectAtIndex:(row % self.dataSource.count)] objectForKey:#"key"];
return customRowLabel;
}
#pragma mark - Delegate Protocols
// Notifies Delegate class that an action has been perfomed and passes the Mood String selected
-(void)handlePickerDidFinish:(id)item
{
[self.pickDelegate somePickerFinishedPicking:item];
}
#end
And just instantiate it like so on your parent ViewController:
CGRect rectPicker = CGRectMake(60, 100, 200, 216);
self.somePicker = [[[SomePicker alloc] init] autorelease];
[self.somePicker setPickDelegate:self];
[self.somePicker.view setBackgroundColor:[UIColor clearColor]];
self.somePicker.view.frame = rectPicker;
[self.somePicker.view setTag:777];
[self.somePicker.view setAlpha:0];
[self.view addSubview:self.somePicker.view];
~/End of Line

Two uipicker in the same view

what i am trying to do is to put two uipickers on the same view, i read somewhere that one of them should have its own separate delegate i tried to do so but i couldn't make it work properly.
Some times when i run the application the second application just stops working with no errors on the console.
this is the .h file for the view:
#interface FirstViewController : UIViewController {
IBOutlet UIPickerView *cities;
NSMutableArray *array;
NSString *picked;
}
#property(nonatomic,retain) IBOutlet UIPickerView *cities;
#property(nonatomic,retain) IBOutlet NSMutableArray *array;
and here is the .m:
#implementation FirstViewController
#synthesize cities,array;
-(void) getCities:(NSString *)link{
url=link;
NSString *str=[[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:url]];
if([str length]==0){
[str release];
return;
}
SBJsonParser *parser=[[SBJsonParser alloc] init];
array=[[parser objectWithString:str] copy];
[receivedData release];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { // This method needs to be used. It asks how many columns will be used in the UIPickerView
return 1; // We only need one column so we will return 1.
}
- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { // This method also needs to be used. This asks how many rows the UIPickerView will have.
return [array count]; // We will need the amount of rows that we used in the pickerViewArray, so we will return the count of the array.
}
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { // what happens when selecting rows
picked=[array objectAtIndex:row];
}
- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { //method asks for what the title or label of each row will be
return [array objectAtIndex:row]; // We will set a new row for every string used in the array.
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[sv setScrollEnabled:TRUE];
[sv setContentSize:CGSizeMake(320, 800)];
[self getCities:#"any url"];
[super viewDidLoad];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc
{
[super dealloc];
}
#end
and for the second uipicker i added an nsobject to the view and changed its class to "SecondPickerDelegate" which i created before and this is its code:
.h
#import <UIKit/UIKit.h>
#interface FirstViewSecondPickerDelegate : UIViewController<UIPickerViewDelegate>{
IBOutlet UIPickerView *specialities;
NSMutableArray *array;
NSString *picked;
}
#property(nonatomic,retain) IBOutlet UIPickerView *specialities;
#property(nonatomic,retain) NSMutableArray *array;
#property(nonatomic,retain) NSString *picker;
#end
the .m file:
#import "FirstViewSecondPickerDelegate.h"
#import "JSON.h"
#implementation FirstViewSecondPickerDelegate
#synthesize specialities,array,picker;
-(void) getSpecialities:(NSString *)link{
url=link;
NSString *str=[[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:url]];
if([str length]==0){
[str release];
return;
}
SBJsonParser *parser=[[SBJsonParser alloc] init];
array=[[parser objectWithString:str] copy];
for(int i=0;i<[array count];i++){
NSLog(#"index %i",i);
NSLog(#"value %#",[array objectAtIndex:i]);
}
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { // This method needs to be used. It asks how many columns will be used in the UIPickerView
return 1; // We only need one column so we will return 1.
}
- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { // This method also needs to be used. This asks how many rows the UIPickerView will have.
return [array count]; // We will need the amount of rows that we used in the pickerViewArray, so we will return the count of the array.
}
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { // what happens when selecting rows
picked=[array objectAtIndex:row];
}
- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { //method asks for what the title or label of each row will be
return [array objectAtIndex:row]; // We will set a new row for every string used in the array.
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
picked=#"1";
[self getSpecialities:#"http://localhost:8080/Test/gs"];
}
return self;
}
/*
-(void) viewDidLoad{
[super viewDidLoad];
}
*/
- (void)dealloc
{
[super dealloc];
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// 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
If any one has a working example for such case please help.
You don't need separate delegates for two UIPickerView's in the same view.
Use the UIPickerView tag property, and then you can differentiate between them in delegate methods.