iphone

Navigate a WebView

Hi, With a webview is it possible to set up a simple 'Back' button (either in a navigation bar or a top toolbar) that doesn't show the back button on the first URL of the WebView - and only appearing on a second URL to get back to the first? Unless I'm getting getting this wrong, in a lot of hybrid native/web apps such as News apps, yo...

Ordering grouped sections in an iPhone UITableView

I have a grouped table retrieved using CoreData. The sections are based on a Boolean field in the SQLLite dB. How can I reverse the order of the groups in the table display? The default is to list the false values first (obviously, as false == 0, true == 1). I guess I could change the database. My field name = isMandatory, so I could c...

How to get rid of keyboard when user taps background (iPhone)

I have a custom UIScrollView which contains UITableView and UITextView. When user clicks on text field, keyboard pops up and it also disappears when user presses Return key on keyboard. Question: How to get rid of keyboard when user taps on UITableView? No matter what I try, I just can't catch any touch events... Using iPhone 3.0 SDK si...

iPhone ModalViewController For Table View Open by Button?

App Description: I have a UIWebview and a Toolbar beneath it. A button on the toolbar should bring up a modal table view, but it does not. The toolbar has four buttons: Previous: Goes to previous site Next: Goes to the next site (these two being different than the default goForward and goBack methods) Menu: Display a modalViewControl...

Data Entry Form Libraries available for Cocoa Touch?

Does anyone know of any libraries for Objective-C Cocoa Touch that provide data entry fields for all different types of inputs (e.g. Date fields, Boolean, Numbers, Integers, etc). Aside from just the built in text fields that accept all inputs? I know you can limit input in the text field delegate and change the keyboard, but stuff like ...

Set Limit For Value, iPhone

Hello all, I have the following code: float valueCalculated = (val1 / val2) * 100; What I want to be able to do is to cap the maximum value of valueCalculated to 100. I believe I could do this using some sort of if statement, but this would mean many more lines of code. Edit// This is not the case, see the answers below. Thanks, ...

Pointer reference?

Hi, I'm pretty new to iPhone application development and I'm doing well so far. But at one point my App doesn't do what it is intend for... It's a tableview based app and i'm pushing a new controller onto the stack to get some Userinput, but when the controller is popped again the data is somehow gone. Perhaps I've missunderstood somethi...

rotating UITableViewController manually

Hi there, I am trying to do something I am not really sure is possible :) I have application that is in portrait mode and doesn't react to device rotation. Almost all parts of app work best in portrait so I disabled autorotation. But one part should be viewed in landscape. I just drawed my view rotated by 90 degrees and with this force...

Are instance variables set to nil by default in Objective-C?

Hi there, I'm sorting out some memory issues with my iPhone app and I've just been thinking about some basics. If I setup an ivar and never end up using it in the lifespan of my object, when I call dealloc on it, will that cause a problem? E.g. @interface testClass { id myobject; } @property (nonatomic, retain) id myobject; @end @...

Restore Backlight To Previous Level, iPhone

Hi there, I was working on my app recently and wanted to change the brightness of the backlight. I then wanted to restore the backlight level to it's original setting on exiting the app. Here is the code: #include "GraphicsServices.h" - (void) viewWillAppear:(BOOL)animated { NSNumber* bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR(...

iPhone - calling a method in parent view controller

Hi, have hunted around for an answer to this one, but can't seem to find a definitive solution - hoping someone can help here! I'm building a multiview app for the iPhone. I've created a UIViewController called "MainViewController", which loads in other views as required. There's quite a lot of navigation between screens, so what I'd ...

Can we enable looping of rows in a UIPickerView as we do it in UIDatePicker?

I am developing an App where i am struck with the looping of rows in a UIPickerView. Can anyone please help me? it would be of great help if anyone would post the solution. I want the rows in a UIPickerView scroll continuosly in a circular manner without having a end point. ...

Showing an alert in an iPhone top-level exception handler

I'm trying to display a UIAlertView in a top-level iPhone exception handler. The handler function looks like this: void applicationExceptionHandler(NSException *ex) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:[ex reason] ...

iPhone SDK: I need a Subview initialized when loading, hidden when done

My Setup: In my iPhone app, I have a loading View (which is an UIImageView itself) and two subviews on the loading View, an UIIndicatorView and an UILabel. To view it, I call the [self.view addSubview:loadingView] method, and to hide it i use [loadingView removeFromSuperView]. In my app to refresh my data i have the method -(void)refre...

IPHONE: searching for a value in a sub dictionary inside a Dictionary

I have a dictionary of dictionaries and I have retrieved from a plist. Suppose the high hierarchy dictionary is COUNTRIES and each sub dictionary is a COUNTRY. Each COUNTRY sub dictionary has keys like name, currency, population, flag, etc. After retrieving the dictionary and its subs to a variable as in NSMutableDictionary * countri...

Code crash on iPhone Simulator but works on actual iPhone device?

This is an extremely weird problem: wondering if anybody has experienced this before. My code, an RSS parser of Flickr photos (RSS feed), works perfectly on an actual device, but allocates a ton of memory and freezes up my entire computer when run on the simulator. I know usually it's the other way round for people, but this is acting w...

what is the recommended approach for taking multiple pictures with UIImagePickerController -takePicture

The docs hint at the ability of takePicture to run multiple times in a single modal view. Particularly "This supports taking more than one picture without leaving the interface, but requires that you hide the default image picker controls." I'd like to take 25 pictures in roughly 4 seconds, however from what I've read, there are issues ...

How to avoid data lose when UIImagePickerController unloads my controller?

I am using UIImagePickerController to take a photo from the camera. However, the I find that randomly my calling controller (the one that is shown before the UIImagePickercontroller is shown) gets unloaded. I logged the viewDidUnload, and indeed it does get called. When the camera is done and dismissed, my controller's viewDidLoad will b...

How do I add a button to my navigationController's right side after pushing another view controller in?

So, immediately after pushing a view controller to my tableView, // Override to support row selection in the table view. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here -- // for example, create and push another view controller. AnotherViewCon...

UIProgressBar with streaming and Playing progress

Hai all, in my audio streaming application i like to show the progress of downloading and playing, when i tried it with MPMoviePlayerController, it shows both progress in the same progress bar, is there any way to implement (or use) the applies default progress bar in our application ? thanks in advance ...