Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

winpiet1706

macrumors newbie
Original poster
Mar 30, 2013
3
0
Hello guys!

I wanna implement a PSMultiValueSpecifier in my App, so Users can change the Animation of iCarousel. I tried a lot now, but i can't figure out the right code (for my ViewController.m) ..

Maybe you can help me with that..

I wanna have something like that:

if(value 1 clicked) { self.photoCarousel.type = iCarouselTypeRotary; } elseif(value 2 clicked){ self.photoCarousel.type = iCarouselTypeCylinder; }

... and so on ( i have 6 values).

I really hope, you can give me the code, so i can implement it

My root.plist you can see here:
gq2eU.png
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,563
6,062
What do you want to have happen, what code have you tried, and what is that code actually doing?

Are you trying to add some settings for your app to the iOS Settings application and then read the values that are set in your app?
 

winpiet1706

macrumors newbie
Original poster
Mar 30, 2013
3
0
Are you trying to add some settings for your app to the iOS Settings application and then read the values that are set in your app?

Yes, excactly! :p

I have 6 Values in my root.plist.. Now, i want to add a code to my ViewController.m.

I think i need an if-statement there, but i don't know the syntax, because this is the first time, i work with the settings.bundle
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,563
6,062
I've never done this before, but googling about it has led me to believe that to access the values set in the settings app, you should use NSUserDefaults. So try something like this:

Code:
switch ([[NSUserDefaults standardUserDefaults] integerForKey:@"animation_settings"]) {
    1: // Rotary...
        break;
    // Your other possibilities
}
 

winpiet1706

macrumors newbie
Original poster
Mar 30, 2013
3
0
I've never done this before, but googling about it has led me to believe that to access the values set in the settings app, you should use NSUserDefaults. So try something like this:

Code:
switch ([[NSUserDefaults standardUserDefaults] integerForKey:@"animation_settings"]) {
    1: // Rotary...
        break;
    // Your other possibilities
}

Thank you very very much! That's the code I needed ! You really helped me :) Thank you!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.