[iPhone SDK] Preference view design/implementation

Hi, everyone!
I want to add preference view in my application (build on iPhone SDK 3.0), but don't want to use preference bundle for several reasons.
And I can't find any suitable UI component to do it (maybe it's UITableView with custom views (with rounded corners)?
Any thoughts on it?
Thanks for attention.
Have a good day

The rounded corners you see in the system Settings app are produced by a UITableView created with UITableViewStyleGrouped. Each group of cells in a rounded frame is a section of the table view, so you can duplicate a typical Settings page by setting the number of sections and the number of rows per section.
It looks like you could build most of the cells in Settings by simply adding your own images and/or controls to standard UITableViewCell instances.
Several of the pages in the UICatalog sample app provide good examples of how to code Grouped style table views with cells similar to some of the Settings cells. That sample code is for 3.0, btw, but almost all of the code is appropriate for 2.x as well.
If you need help with table views and table view cells in general, see the Table View Programming Guide for iPhone OS.
For more basic instruction, see Chapter 8 of +Beginning iPhone Development: Exploring the iPhone SDK+ by Mark and LaMarche.

Similar Messages

  • IPhone SDK Calendar View Control/Tool??

    I guess I was expecting something in the iPhone SDK toolkit to display a full calendar (as in the iPhone calendar application) rather than just a date picker.
    Does anyone know of any Cocoa code that displays calendars like in the iPhone Calendar application that could be used with the iPhone SDK?
    Thanks.

    I did not say it was "difficult", it was just not as easy as it might seem. Our programmer cranked out the core class in a few days, but testing revealed the periodic quirks as I mentioned. So, I would encourage you to continue.
    I am reluctant to tell you my app as I am sick of the trash talk and complaining about the pricing and do not want to read any more on this discussion group. The calendar looks almost exactly like Apple's but without the animation on month changes or fast month changing (and there are no appointment functionality).
    With no disrespect to you or Shanghai, the buildings are works of art, the people are friendly, but the air quality is terrible and my son hates to take a breath there.

  • How to switch between views in iPhone SDK

    I have been tasked to learn the iPhone SDK. I know Actionscript, Javascript and some Java, but I cannot understand the iPhone SDK at all. I cannot understand the syntax or how the multitude of files work together. Also, there are no tutorials for complete beginners that show step-by-step what to do and why.
    All I am trying to make is an application with a couple of views that change when the user touches a button. What is the easiest way to switch from one view to another?
    Also, what is an AppDelegate? What is "synthesize"? What is "nonatomic,retain"? Why can't I write code like this... theButton.onClick=loadView("NewView");

    Ok, you really need to read up some on how Objective-C and Cocoa work.
    That said, If you make a new project in XCode using the "Utility" template, you can immediately run it and see a view transition (flip).
    Ultimately, however, what you're looking to do is way beyond what you should be expecting to be to be able to do at this point. Programming a scripting language (Javascript, ActionScript) is much different than programming in C/C+/Objective-C/Objective-C+. While not directly applicable to the iPhone, you'll probably want to buy and read Aaron Hillegass' book "Cocoa Programming for Mac OX X 3rd Edition".
    There is a tutorial on the iPhone Dev Center (log in, main page, bottom right, under "resource types", click "Guides", and look for "iPhone Application Tutorial" on the next page) that is worth reading.
    rob.

  • IPhone SDK UISegmentedControl and hiding view

    Hello,
    Im slowly getting to grips with the iPhone SDK but having a problem today, I have a UISegmentedControl setup to a toggleSetting function but this toggleSetting calls a url in the background for some data, but this freezes my application while the web request is taking place, this can take around 2 seconds and so I made another view (loadingView) with a loading screen thats animated and I want to show this whis the connection is taking place and then hide it again once complete.
    I don't have any problems with showing or hiding the view until the web request happens.
    When my app loads I call \[loadingView setHidde:YES] which hides my view straightaway, then my toggleSettings method is below, but this does not cause the view to show while the quest is taking place, I think it is showing an hiding it instantly as if I just ask to show it, it will show but only after the web call is complete. Anyone got any pointers???
    <code>
    -(IBAction)toggleSetting:(id)sender
    [loadingView setHidden:NO];
    UISegmentedControl *segmentedControl = (UISegmentedControl *)sender;
    NSInteger segment = segmentedControl.selectedSegmentIndex;
    if(segment==0) {
    NSURL *url = [NSURL URLWithString:@"http://myurl"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil ];
    [loadingView setHidden:YES];
    </code>

    I don't have code handy but take a look at the class reference for NSURLConnection and related calls.
    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:YES]; would be a good start.
    You want to use a call that will create some callbacks to update you when a connection is confirms, how many bytes are transfered, etc. so be sure to write the call functions.

  • IPhone SDK: auto-rotation sets wrong bounds in view?

    Hi all,
    Can anybody confirm if this is a bug in the iPhone SDK? I have a ViewController that defines as its view a DimensionsLogger, which is a trivial subclass of UIView that just logs its frame, bounds and center properties when layoutSubviews is invoked.
    When I set this view as the root view in my application, the dimensions are logged like so (portrait mode):
    Bounds: (0.000000, 0.000000) x (320.000000, 460.000000)
    I rotate it to landscape mode and the bounds are logged:
    Bounds: (0.000000, 0.000000) x (390.000000, 390.000000)
    Bounds: (0.000000, 0.000000) x (480.000000, 300.000000)
    Then back to portrait mode:
    Bounds: (0.000000, 0.000000) x (390.000000, 390.000000)
    Bounds: (0.000000, 0.000000) x (320.000000, 460.000000)
    So far, so good.
    When I add my DimensionLogger + ViewController to a NavigationController, however, the same process (repeated several times) yields the following output:
    Bounds: (0.000000, 0.000000) x (320.000000, 416.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    The bounds value never returns to the original dimensions.
    Am I missing something, or is this a bug? The practical consequence of this is that it seems impossible to combine the following 3 UI elements:
    - "anchoring" something to the bottom of a view, like a UIToolbar (NOT a tabbar)
    - Nesting that view in a UINavigationController
    - Supporting portrait and landscape interface orientation.
    Also, if I file this as a bug, is there any way to search the bug report tool to see if this has already been filed? I've logged into the tool and I see some search functionality but it only seems to search bugs I've previously filed.
    Thanks,
    Russ

    Just wanted to add that I've tried this in the simulator and on a provisioned iPod touch, same results on both.
    Russ

  • Learning iPhone SDK - Trying to draw an image

    Although I have programmed for Mac in the last years, I have never used Mac-specific technologies as Cocoa (I have programmed more in OpenGL, SDL, and the like).
    Now I am getting started with the iPhone SDK. I'd like to do some OpenGL|ES stuff, but since it is not supported in the Simulator, and you need to join the Developer Program to test stuff on directly on the device (and admission of new members is closed right now), I am focused on other stuff right now, like using Core Graphics for drawing images on the iPhone.
    My application is based on the Cocoa Touch Application template. I left the default code except for a few changes.
    In file "UntitledAppDelegate.m", I have changed the method applicationDidFinishLaunching to:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
    [window addSubview:contentView];
    [window makeKeyAndVisible];
    Then, in the MyView interface file (MyView.h), I have added the attribute "UIImageView* image;" to the class, which is declared as a property, and synthesized.
    In the class implementation (MyView.m), I have changed the method initWithFrame to:
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    self.backgroundColor = [UIColor darkGrayColor];
    image = [self loadImageView:@"box01.png"];
    [self addSubview:image];
    return self;
    loadImageView is a private method I have implemented as:
    - (UIImageView *)loadImageView:(NSString *) imageName {
    UIImage *img = [UIImage imageNamed:imageName];
    UIImageView *theView = [[UIImageView alloc] initWithImage:img];
    return theView;
    Since I have loaded the UIImage, and initialized a UIImageView with it, and the image view is added as a subview of the main view attached to the window, I thought it should be everything needed to draw an image on the screen. But nothing is visible. The screen is simply black when I run this on the Simulator. It doesn't even set the background to dark gray.
    So I need some help with this, I sure that anyone with experience in Mac programming will know how to help me.
    Thank you in advance.
    Message was edited by: Jedive

    I removed the XIB file from the project, but that didn't help. It was a problem with my inexperience with Objective-C. When accessing class properties in a method of the same class, i was not putting "self." before the property (in C++ that's redundant). For example, in the line "window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];". After adding it, it works correctly.

  • Your Session has Expired - iPhone SDK 3.1.2

    I am new in development. I had my activation done. I try to download from my Mac - Safari and Firefox and I have this error.
    Your session has expired.
    Please return to the ADC Member Site and attempt to download the file again.
    If you feel you received this message in error, please reference this code when contacting the ADC Support Team: V2
    I had been trying for almost a week and still have this error. I had submitted my problem to Apple but no reply from them. Anyone can advice on this.
    regards

    Updating - my issue was solved:
    I've noted that when I was trying to download it through my VPN connection (which connects my internet with my office internet), I forgot to check the "Send all traffic over VPN connection" under the "system preferences - network - My VPN Connection - Advanced...". After checking that this option was "enabled" and all of my network traffic was passing through the VPN, I succeeded downloading it. By that point it must be something wrong with my ISP "Telefonica Espana - Madrid".
    It turns out to be a "intercept proxy" which was implemented by them. As I'm a new subscriber to their service, by default, they redirect my internet connection through this proxy, which they "offer" as a "security" service in order to avoid spamming, fishing websites threats, "parental control" over the web and finally as a "ad blocking proxy". My actual ISP (telefonica espana) offers it by default to their new subscribers and after 30 days they charge us 3,50 EUR/month for this proxy service called "Canguro Net Plus". Actually this clumsy proxy service was blocking my download requests on http://developer.apple.com/iphone. Even after disabling the "Canguro Net Plus" service through its web page configuration, it was still forcing my internet connection to pass through their clumsy proxy. I had to call to their customer service number to request it to be cancelled (They will only accept to cancel it if you call them by phone). After that I'm now able to download the iphone sdk 3.1.3, 2.82 GB in 45 minutes.
    So, if the workaround mentioned above, regarding the change from http to https, doesn't work for you, I suggest you to try a VPN connection in which you must be able to access the internet as well. As a diagnose action you can even try to download it through the "Tor" (The onion router) just to let you verify that through "Tor" you are able to download just a small part of the 2.82 GB. "Tor" is really slow therefore you won't be able to download the iphone sdk (as I said - it's only for a diagnose action). It'll just indicate you that your ISP probably is blocking your download with a clumsy "intercept/cache/transparent proxy" service. Maybe you are able to detect that your ISP is applying some kind of proxy service over your internet connection. Just google it or contact your ISP customer service.
    Good luck!

  • IPhone SDK - Ideas for pop-up menus

    I have a screen where there are quite a few items which are of the multiple-choice type. In other platforms we use a combo box (pick lists) to do this.
    On the iPhone SDK the only thing that comes close is the UIPickerView which is too heavy IMHO.
    Currently i am using a full screen pop-up with a UITableView inside it for the menu items. It is functional but not cool.
    I guess i could create a view which is rendered as a pop-up and add it as a subview to the parent and make it behave like a pop-up menu.
    Has anyone tried do implement one? I would greatly appreciate your ideas on this.
    Thanks,
    -TRS
    -TRS

    "redstonegirl" <[email protected]> wrote in
    message
    news:eo0dfm$k4r$[email protected]..
    > I'm new to this, and I'm wondering if it is suggested to
    use this drop
    > down for a side menu bar. I am considering doing this
    but my menu must be
    > on the side.
    Yes, once you master the tutorial on creating these type of
    menus, you can
    have them as dropdowns, or flyouts (as they are commonly
    called when
    attached to a vertical menu system).
    Nadia
    AdobeĀ® Community Expert : Dreamweaver
    Tutorials |SEO |Templates
    http://www.DreamweaverResources.com
    http://www.perrelink.com.au
    CSS Tutorials for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/css.html

  • Listcontrol Equivalent in iPhone SDK

    Hi,
    Iam newbie to iPhone OS.I need to design a Screen which should have a bar, it can be a Navigation Bar. And the View attached to bar should have a
    List control or Tree control functionality.
    Can any one explain me the possible approaches I can follow with the available controls in the iPhone SDK?
    Thanks
    Satya

    File a bug report if you can reproduce a problem that relates to Apple.
    bugreport.apple.com

  • Apparent Error in iPhone SDK template

    There appears to be an error in the "Utility Application" template in Xcode's iPhone SDK.
    The UIView subclasses that it creates, MainView and FlipsideView, contain this init function:
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    // Initialization code
    return self;
    but since the MainView and FlipsideView nib files instantiate the view objects, this method is not called. It should be this method instead:
    - (id)initWithCoder:(NSCoder*)coder {
    if ((self = [super initWithCoder:coder])) {
    //something
    return self;

    Hi, have you checked this with a breakpoint? I thought since initWithFrame method is the designated initializer for the UIView class it's called within initWithCoder.

  • IPhone SDK - What is the equivalent of a combo box

    I have a screen where there are quite a few items which are of the multiple-choice type. In other platforms i use a combo box (pick lists) to do this.
    On the iPhone SDK the only thing that comes close is the UIPicketView which is ugly IMHO. it takes too much real estate and too heavy.
    Is this is the only control available now?
    Also does the UIPicker come with an associated control which will launch the picker? What i mean is on other platforms and on the web there is a text field with a button with a down arrow next to it. Clicking either on the text field or the down arrow drops the list down. Is there a similar control on the iPhone which when clicked launches the picker OR do i have to create a button or a custom view which will launch the picker?
    Thanks for reading this and for your feedback.
    -TRS

    I do not believe there is an equivalent of -D in the DB JVM, a possible solution is:
    Load a properties file into the DB using Loadjava, then open this file from your Java code using Properties.load(), then iterate the properties calling System.setProperty().
    Chris

  • IPhone Calendar List View Extends Back Only One Year

    My iPhone calendar List view extends back approximately one year despite the fact that I have calendar entries extending back to 1999 and that older data is visible under the Day and Month views. This is a problem because the only search mechanism in iPhone calendar is through the List view. Therefore, any search I conduct extends back only to the data in the List view ... which means back only one year.
    Does anyone have any thoughts or suggestions on how I could change this such that the List view extends to include ALL of my calendar entries and is in conformity with the Day and Month views? (I wanted to ask if anyone knows how to "correct" this, but perhaps Apple has designed it this way to speed-up the searching in List view ... I'm not certain.)
    I am currently running the most recent iOS update, am syncing my iPhone calendar via MobileMe, have upgraded to the new version of the MobileMe calendar, and have ALREADY reset my sync. history, deleted my iPhone calendar and re-synced it, etc. These don't resolve the problem.

    I've noticed that the date to which the List View will "look back" will change depending on software updates or syncs.
    For instance, a few weeks ago my List View went back to December 2009 ... now it goes back to Jan. 2010 (i.e. I lost a month of "look back"). I do not specifically recall what triggered this change, but I reset my sync. log during this period.
    If you make no changes to the sync. log or update the software, the List View start date will stay constant I believe. For instance, if the List View goes back to Jan. 1, 2010 right now it should stay that way until you reset the sync. log or update the iPhone software. Theoretically then the List View can "look back" much longer than 12 months assuming you make no changes to the sync. log or update the software. Of course, this doesn't address our issue here, but I thought I would point out that there seems to be a consistent pattern here and not some random bug screwing things up.
    I'm still thinking that this is the way Apple intended it to work. In other words, that Apple felt it necessary to limit the calendar search feature to approximately 12 months worth of calendars. I hope I'm wrong.

  • IPhone SDK 2.2 memory corruption

    Hello. I'm working on an application for iPhone SDK 2.2 and seem to be having weird memory corruption problems. Not necessarily leaks because using Instruments shows my memory stamp never going above about 1.8 megs. The nature of the app is a database of animals so I'm constantly loading and unloading sounds and images. None of the objects are very large (at most I'll have 4 800k pngs loaded at once) and I've checked and rechecked my alloc/retain/release and everything is in order (hence no memory usage increase). However...after using the application for a while I'll notice strange behavior. For example:
    1) we have a UILabel as the title for each page. After a while the font size of this will change.
    2) I have several screens with a subclassed UIScrollView where images are loaded and then added to. The problem shows itself here by the images not showing up. there's no crash, stepping through the debugger shows that the image loads up fine, it's just that the image is not there.
    3) I have a UILabel at the top of an animal description screen, which in the nib file is called "Animal Name" by default. This will change to show "Animal Name" at the top.
    I've removed all audio in our latest build so that isn't the problem. What I'm starting to suspect is that altering anything defined in a nib file will cause corruption. For example, the UIScrollView is defined in the nib file, and I constantly am reassigning the contents of that with a UIImageView. This UIImageView is handled within the subview class like :
    UIImageView *imgView = [[UIImageView alloc] initWithImage: [ UIImage imageWithContentsOfFile:[[NSBundle mainBundle ] pathForResource:imageToLoad ofType:@"png" ]] ];
    imgView.tag = 50;
    [self addSubview:imgView ];
    [ imgView release ];
    Then later when moving away from the screen I'll find that view's tag and remove it from the superview (since addSubView increases the retain count, the alloc+addSubView is cancelled by release+removeFromSuperView)
    I can't explain why titles that are never changed would be affected, but it must somehow be related. What I'm wondering is: are there any known issues involving modification of the contents of objects defined in Nib files? Perhaps the memory allocated when initWithNibName is restrained, then any modification of objects allocated within it can cause corruption. I'm starting to think I should just alloc and free anything modified in code and skip using nib files altogether (I reset the text on buttons for example). If this is a known issue please let me know. I'll give you more information if I can.
    Thank you

    Just download the huge SDK package and install. No need to uninstall the old SDK.

  • IPhone SDK : Communication between iPhone client and a remote server

    Hi,
    This is w.r.t iPhone Cocoa Touch native application.
    i need to populate my application 's data from a remote application server ( which in turn connects to the database) . I require some tips in the communication between client sitting on the iPhone and the remote application server. I am planning to proceed in XML transaction way.
    I referred the SeismicXML sample application provided by Apple. In this sample,client reads the physically existing xml file from @"http://earthquake.usgs.gov/eqcenter/catalogs/eqs7day-M2.5.xml"; and the client parses the xml file and display the content on the table view.
    i have following 2 queries ,
    1. I do not want to read from a physically present file,i want the data to be transferred on the go.
    Means, request should be sent from the client to a application server and the server process returns the data in form of xml file ( but its not creating any physical xml file) .
    Basically i am looking for request - response concept.
    2. Can we call a java process(which returns xml data) running on a remote server from the cocoa touch client.? If not java process,what would be other best way...
    i am going through the Apple provided frameworks. Do any of the iPhone SDK frameworks support this request? If some one has any idea on the above mentioned queries, pls help me.
    any pointers will also be helpful.
    It might be too early to talk about these,but i have to take some business decision related on this.
    thanks in advance.

    You already know how to send a string via HTTP Post? And you know how to make XML into a string? Put the two together.

  • IPhone SDK b3: How I fixed broken (blank) Research Assistant

    Hello, I wanted to give this thread a new title as the original thread didn't indicate "iPhone SDK" in the title, and was in reference specifically to b2. The original thread:
    http://discussions.apple.com/message.jspa?messageID=6935634#6935634
    Here are my findings. Research Assistant was working great for me until I upgraded my original (b1) iPhone SDK directly to b3, skipping b2 entirely. In reading posts in the aforementioned thread, this problem seems to occur when going from b1 -> b2, and I can surmise probably also from b1 -> b2 -> b3.
    The comments in the aforementioned thread were useful in helping me reach a fixed state, for which I conclude a clean re-installation of b3 was necessary. Just doing steps 3) through 6), inclusive, _did not fix my problem._
    1) Uninstall iPhone b3 SDK
    sudo /developer/Libraray/uninstall-devtools --mode=all
    2) Reboot. Reinstall iPhone b3 SDK. Reboot.
    3) Launch Xcode. "Go to Xcode : Preferences... : Documentation"
    4) Click + to add the following entries (you might already see a bunch of grayed-out entires):
    /Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets
    /Developer/Documentation/DocSets
    /Library/Developer/Shared/Documentation/DocSets
    5) Exit and relaunch Xcode
    6) Go to "Project : Edit Project Settings" and click on "Rebuild Code Sense Index".
    After doing all of this, my Research Assistant now works. I wanted to share this with the community in hopes that others learning the iPhone SDK aren't dissuaded by this issue, which can cause a very substantial barrier to learning its APIs quickly.
    -Jeff Ishaq

    Thanks for all the tips. Unfortunately for me it still doesn't work
    After trying for a day I give up ... bulky docs pane here I come.
    Might be because I am using standard Xcode Dev Tools and not the iPhone SDK version of it, but I am still hoping Apple will release a fix for this annoying bug.

Maybe you are looking for

  • Is my HD completely dead or can it be saved?

    Hi everyone, I have a MacBook Pro (13 inch, Mid-2010) running OS X Mavericks 10.9 and it seems the HD has died. I'd be incredibly grateful if anyone could offer me some help and advice. I was using my MacBook as usual this morning. I had a few work d

  • Acrobat Pro 9.3 freezes and locks up computer

    Something has gone VERY wrong with Acrobat 9.3 - every time I try to save or print anything, it not only locks up and stops responding but also causes Windows 7 to come to a screeching halt. Sometimes I can recover the Windows 7 crash without rebooti

  • Is there an app where you can take PROFESSIONAL photos?

    I love taking pictures & i wanted to know if there was an app for professional photos.?

  • Problem with latest Update IOS 6.1.2 in Itunes

    Ipod 5th Generation after re-establishment always in factory state. What can I do now? Ipod always tells to connect with Itunes. But even when I connect with Itunes I can't update the latest Softwareupdate (IOS 6.1.2). Hope you'll be able to help me.

  • Converting zulu format to date and time format

    I want to convert zulu format to regular dateand time format. so for e.g I have this date and time in my table 021731ZJUN06, I want to convert it to 2006-06-02 17:31:00 I wrote this in sql server, but don't know how to do this in oracle ALTER functio