preference cell types and variables

Discussion in 'iPod touch Firmware 1.1.4 Discussions' started by benthecomputerman, Jul 19, 2008.

  1. benthecomputerman

    benthecomputerman New Member

    Joined:
    May 23, 2008
    Messages:
    12
    Likes Received:
    0
    does any body know all the cell types and variables for the preference app
    like "PSSwitchCell" PSGroupCell" ect...
  2. mossme89

    mossme89 Member

    Joined:
    Dec 22, 2007
    Messages:
    659
    Likes Received:
    7
    could you give more information? i'm not really sure what you are talking about, but i'd be glad to help

    Please Register or Log in to view images

  3. benthecomputerman

    benthecomputerman New Member

    Joined:
    May 23, 2008
    Messages:
    12
    Likes Received:
    0
    like the switches and sliders and keyboards on iphone preferences app
    like "PSEditTextCell" make a keyboard come up
  4. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    You can put anything you want in a preferences table.

    First you create a UIPreferencesTableGroup full of UIPreferencesTableCells which can be UIPreferencesTextTableCell, UIPreferencesControlTableCell, or whatever else you need.

    Once you have your cell set up, just add what you want as a subview of that cell. Want a switch, UISwitchControl. Want a slider, UISliderControl. Want a segmented button, UISegmentedButton. Want a text field, UITextView. Want any other object at all, an NSObject will do.

    Code:
    UIPreferencesTableCell *myCell = [[[UIPreferencesTableCell alloc] initWithFrame:predefinedFrame] autorelease];
    UISwitchControl *mySwitch = [[[UISwitchControl alloc] initWithFrame:anotherPredefinedFrame] autorelease];
    [myCell addSubview:mySwitch];
    Also note that you can as many subviews you want. Want a cell with an image, a slider, a text label, another preferences table, and a web page? Then go ahead and make it.
  5. benthecomputerman

    benthecomputerman New Member

    Joined:
    May 23, 2008
    Messages:
    12
    Likes Received:
    0
    how would i make a preference switch that will change this in red "N45AP.plist"

    <key>bundles</key>
    <array/>
    <key>capabilities</key>
    <dict>
    <key>activation</key>
    <true/>
    <key>camera</key>
    <true/>
    <key>deviceName</key>
    <string>iPhone</string>
    <key>editableUserData</key>
    <true/>
    <key>international</key>
    <true/>
    <key>ringer-switch</key>
    <true/>
    <key>unifiedIPod</key>
    <true/>
  6. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Create an app that loads the M68AP.plist into memory. then load the capabilities dictionary and set the value of the switch to equal the bool value of the ringer-switch key, from the example provided. Then, when the preferences are saved, set the bool value of that key into the dict alrady obtained, and write it to a file called M68AP.plist

Share This Page