xStep
Apr 4, 07:12 PM
rustywild sent me a private message and this is my response to that.
I only slept 4 hours last night so I might still be misunderstanding. Part of your explanation didn't make any sense given your code.
This is what I believe you have�
A dictionary where the keys will be the left most component that sets up what the right side component should display. The keys are placed into a sorted array. Each time component 0 changes, you want to update the right side component. Each time a choice is made, you want it reflected in two labels. The following code should do that for you. This is untested code.
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if (component == kPotenciaComponent) {
NSString *selectedState = [self.potencia objectAtIndex:row];
// Update values array for key of component 0.
[self.cantidad release];
self.cantidad = [potenciavoltaje objectForKey:selectedState];
[pickerView reloadAllComponents]; // Might not need to load all, but I do.
[pickerView selectRow: row inComponent: kPotenciaComponent animated: YES];
[pickerView selectRow: 0 inComponent: kCantidadComponent animated: YES];
label1.text = [self.potencia objectAtIndex:row];
label2.text = [self.cantidad objectAtIndex: 0];
}
else {
label2.text = [self.cantidad objectAtIndex: row];
}
}
The labels are updated here because that is when the change is occurring in your selection. You may also want to set them when you first setup your two data arrays in your viewDidLoad method.
P.S. Looks like you are a native Spanish speaker. Welcome to the challenge of communicating technical problems in another language. :)
I only slept 4 hours last night so I might still be misunderstanding. Part of your explanation didn't make any sense given your code.
This is what I believe you have�
A dictionary where the keys will be the left most component that sets up what the right side component should display. The keys are placed into a sorted array. Each time component 0 changes, you want to update the right side component. Each time a choice is made, you want it reflected in two labels. The following code should do that for you. This is untested code.
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if (component == kPotenciaComponent) {
NSString *selectedState = [self.potencia objectAtIndex:row];
// Update values array for key of component 0.
[self.cantidad release];
self.cantidad = [potenciavoltaje objectForKey:selectedState];
[pickerView reloadAllComponents]; // Might not need to load all, but I do.
[pickerView selectRow: row inComponent: kPotenciaComponent animated: YES];
[pickerView selectRow: 0 inComponent: kCantidadComponent animated: YES];
label1.text = [self.potencia objectAtIndex:row];
label2.text = [self.cantidad objectAtIndex: 0];
}
else {
label2.text = [self.cantidad objectAtIndex: row];
}
}
The labels are updated here because that is when the change is occurring in your selection. You may also want to set them when you first setup your two data arrays in your viewDidLoad method.
P.S. Looks like you are a native Spanish speaker. Welcome to the challenge of communicating technical problems in another language. :)
c-Row
Apr 4, 05:38 AM
WipEout Pure
Lumines
Gottlieb's Pinball
Mercury Meltdown
Lumines
Gottlieb's Pinball
Mercury Meltdown
likemyorbs
Mar 9, 06:21 PM
We should all post pictures of ourselves so that when we respond to posts people can picture us in their heads. Ill post mine as soon as I'm out of class in an hour! Can't attach files from my iPad since their is no damn filesystem. :)
doucy2
Dec 4, 01:29 PM
lol, good thing you sold it, but he paid high for a used shuffle. 99$ seems like a great price shipped but I hate the fact that the shuffle shuffles!
the shuffleing function can be turned off
btw i sent you a PM
the shuffleing function can be turned off
btw i sent you a PM
more...
BlindMellon
May 2, 06:59 AM
those images again? those things would rock like a babies cradle when you lay them down and apple would be a laughing stock.
Yeebles
Jan 12, 09:34 AM
I love macs they are so cool. I'm a little skeptical over the iPod. But that's a different matter. I know Apple are always using iThis and iThat. However I think it is a bit cheeky that they are using there legions of lawyers to steal Cisco's trademark. I know that it has the i before Phone but thousands of products exsist with the i before product names. It's only because Apple wants the name. Hypothetically if you made a computer screen and called it iScreen. Then if apple made a screen and wanted to use your name How would you feel if they took it from you due to their stronger legal forces? Not happy I presume. That is the same thing happening to Cisco. I do have an idea which could help Apple. If they want to hear it they can email me.
What is your opinion on Cisco and Apple's dispute?
What is your opinion on Cisco and Apple's dispute?
more...
vistadude
Feb 12, 01:49 AM
Everyone else going to bed is happy because they're laughing at you.
naths
May 5, 03:27 PM
Dont worry about getting one now,if the iphone5 comes out in sept,thats 4+ months away,one of my contracts is up and im going to get a HTC sensation and try that,got to see what all this dual-core is all about,if i like like it then all well and good,if not another contract is up in august so i'll get the 5 then.
more...
Pippa Middleton underwear
Oddetorium: Pippa Middleton
more...
Pippa Middleton at the Roof
Pippa Middleton,
more...
kate middleton underwear model
pippa middleton underwear
more...
PIPPA MIDDLETON UNDERWEAR
pippa middleton underwear
more...
photo of pippa middleton
kate middleton underwear
Pippa#39;s bikini shots have
more...
Billicus
Jul 9, 05:26 PM
I'd be cautious. Either the PB had a malufunction and doesn't work right or it's a scam. Although, I don't have much experience with eBay so it could be legit. Is there a way to track a persons buying/selling record?
Sederick
Apr 4, 10:00 AM
I formatted my new harddrive to my macbook pro and i installed files onto it and so i unplugged the harddrive from my laptop for about a week cause i had moved and i plugged the harddrive to my computer and the option to format it popped up. It was like i never even formatted it before
more...
Aarow
Dec 26, 08:39 PM
I've never had the chance to use their other support page. What's the big difference with this one?
Duff-Man
Apr 25, 07:29 PM
I don't however believe I have broken the rules but if you feel otherwise I hope my apology puts a smile on your face and makes your day just that bit better! ;)
Duff-Man says....not to flog a somewhat dead horse,but you have indeed broken the rules - both the forums and Apple's.
Even *if* your friend paid for it, it's not his to give you to install and use without violating Apple's license agreement, and as for the forum rules, as quoted above it's *very* clear that you've asked for help with software you do not have license to use so yes, you've broken the rules.....oh yeah!
Duff-Man says....not to flog a somewhat dead horse,but you have indeed broken the rules - both the forums and Apple's.
Even *if* your friend paid for it, it's not his to give you to install and use without violating Apple's license agreement, and as for the forum rules, as quoted above it's *very* clear that you've asked for help with software you do not have license to use so yes, you've broken the rules.....oh yeah!
more...
Stella
Apr 8, 09:29 PM
http://www.wirelessindustrynews.org/news-apr-2011/2468-040811-win-news.html
http://www.theregister.co.uk/2011/04/08/apple_icab_considered_harmful/
We've just learned that Apple has ordered the app developer of a Web browser for iPhones and iPads to disable vital functionalities in the two devices. The gatekeepers at the iTunes store, which sell the highly-rated German browser iCab, ordered it to disable all Javascript code in iPads and iPhones.
http://www.theregister.co.uk/2011/04/08/apple_icab_considered_harmful/
We've just learned that Apple has ordered the app developer of a Web browser for iPhones and iPads to disable vital functionalities in the two devices. The gatekeepers at the iTunes store, which sell the highly-rated German browser iCab, ordered it to disable all Javascript code in iPads and iPhones.
MattDSLR
Apr 23, 12:25 AM
OWC here too
more...
Ikyo
Mar 11, 06:46 AM
Yeah, craigslist is up and down. I am selling some of my camera equipment on there and get a ton of emails, but a lot of them are really low offers. I don't mind them, but I laugh when people get upset when I say no.
jenzjen
Apr 17, 04:50 AM
Not sure why you didn't just call Monoprice and ask them, and the product page itself says "does not support audio"
more...
Joshuarocks
Apr 14, 11:31 PM
:confused: Ok then. Diskradar says my disk is excellent, however it has had bad sectors before resulting in lockups and dataloss. It also doesn't let you run disk tests.
Ok, try Disktools Pro - you can run tests with that program.. or if you want REAL TIME diagnostics(something Apple lacks), run the drive diagnostics under windows 7 or boot into Hiren's disk utilities - there it will tell you if your disk is truly bad or warped.
Ok, try Disktools Pro - you can run tests with that program.. or if you want REAL TIME diagnostics(something Apple lacks), run the drive diagnostics under windows 7 or boot into Hiren's disk utilities - there it will tell you if your disk is truly bad or warped.
mikey.f
Oct 25, 12:55 PM
I'm there at 5:30!
Should we have a meeting point, say on the benches or somewhere? :cool:
Should we have a meeting point, say on the benches or somewhere? :cool:
Blue Sun
Feb 17, 02:56 AM
NIN - And all that could've been
Porcupine Tree - Arriving Somewhere
Porcupine Tree - Arriving Somewhere
SamIchi
Sep 18, 02:11 PM
its called the trash can! ;)
I would, but I'm sure someone would like them. The trash would be just a waste. I want to find some used cds too.
I would, but I'm sure someone would like them. The trash would be just a waste. I want to find some used cds too.
bri1232001
Apr 23, 05:23 PM
PM'd
I would be interested to know this as well.
I would be interested to know this as well.
Doctor Q
Apr 26, 02:59 AM
Are you sure you're seeing ads with the same image and linking to the same URL? We have to remove specific combinations.
Designer Dale
Mar 22, 02:42 PM
ISO, Gain Factor, Sensitivity, blah, blah, blah.
Whatever word/phrase one uses, it would still need to be defined.
Or one could put the cam on auto ISO and put a piece of electrical tape over the ISO button :)
Shocking!
Dale
Whatever word/phrase one uses, it would still need to be defined.
Or one could put the cam on auto ISO and put a piece of electrical tape over the ISO button :)
Shocking!
Dale
mpw
Sep 9, 06:28 AM
...What's the most inappropriate act to be on stage at an Apple keynote?...
The Chairman of Sony at last years WWDC? What was the point?
I�ve not seen anyone comment on it, so it might just be me, but anyone else find Gold Diggar sexist?
The Chairman of Sony at last years WWDC? What was the point?
I�ve not seen anyone comment on it, so it might just be me, but anyone else find Gold Diggar sexist?
No comments:
Post a Comment