cocoa-touch

UIViewController subclass initialization

Say I have a FooController subclass of UIViewController that displays a list of Foos. What's the best practice for dealing with my foo property's lifecycle? Do I define the @property as being read/write? It's not really -- once it's been set, changing it would potentially result in inconsistent state. Do I create the @property as readon...

Scrolling of oversized view? (iPhone)

Hi, all! I imagine this is pretty dead-simple, but somehow I haven’t been able to get it to work: I need to display a View containing a group of controls (roughly 800px tall) -- which can be scrolled vertically by the user, as that view is too big to fit on the screen all at once. That’s it. I’d think that this might mean something l...

Can I install an app to the simulator without the source code?

I have a client who wants to just drag and drop the binary to run it in the simulator. I want to build the simulator app and email it to them. What can the client do to install this in the simulator? Is this possible? Thanks for any help. ...

Quartz stretching image selected from imagePickerController

I have an app which allows the user to select an image from camera or photo library. It then places that image in a ImageView. I am then using Quartz to grab the image from that image view and render it along with some basic overlays etc. The issue is that when the image is picked from the camera, or from the camera roll Quartz draws ...

How to determine if an NSTimeInterval occurred during an arbitrary NSDate?

Hi all, I have an NSTimeInterval, and I'd like to know whether that timestamp falls between the start and end of a date. Basically I need to be able to do something like: NSDate *today = [NSDate date]; NSTimeInterval myInterval = someInterval; [date returnYesIfFallsThisDate:myInterval]; Is there a straight forward method to figure o...

Presenting modal view occasionally hides the navigation bar

I've come across this twice now. Sometimes using the following line of code: [self.navigationController presentModalViewController:aViewController animated:YES]; displays the view, but the navigation bar is then hidden. I can write: [self.navigationController setNavigationBarHidden:NO]; to my hearts content, everywhere I can ...

How can I change the default color of the button on iPhone?

How can I change the default color of the button on iPhone? ...

Where to keep .plist file in iphone app

Hi All, I am developing an iPhone app, in which i want use an .plist file to save some config variables. in my xcode where to create that .plist file and how to access it??? thank you, ...

fill NSMutableArray from Another NsMutableArray

i have two different classes with named indexViewController and flashCardQuestionViewController. in the index view controller i have table filled with an array. now i am getting some data from the database.. -(void)getMultipleChoiceAnswer { if(optionid!=nil) [optionid removeAllObjects]; else optionid = [[NSMutableArray alloc] ...

NSArray in iPhone programming

How can I create an NSArray with values prepopulated. That is to say: NSArray *name=[NSArray alloc]; // insert these values: raju, biju.ramu Thanks and regards from raju.. ...

Is there a way to detect what UIView is currently visible?

I have a class that communicates with a web service and is used throughout the app. What I am looking for is a way to display an Error message in a UIActionSheet on top of what ever view the user is in. Is there an easy way to do this? I would like to avoid call back methods in every view if at all possible. ...

Record and email audio files on the iPhone?

Hello, is it possible to record the sound in iPhone 2.1 and then attache it in mail? I have to record any sound on one button click. Please help for that. ...

How to instantiate an NSObject in the Interface builder .xib file

Greetings, I have a view based application project where I have created an NSObject class called "SquareClass". Now, from the Xcode's interface builder, I want to be able to instantiate that "SquareClass" into a square object with global scope, in such a way that, when I create actions from any UI controls(i.e textboxes, buttons etc...)...

How to refresh UITableViewCell?

I have a UITableView with a custom UITableViewCell. In cellForRowAtIndexPath, I assign a font to a label in every cell, since the user can change font size at any time. To change font size, the user clicks a button below the tableview, which dislays another view with settings. Once they have chosen a font size and click done, that vie...

Custom view controller for Settings bundle?

I have an application with a settings view that loads settings dynamically from a remote server. It's working fine. I want to also make these available in iPhone Settings, but the Settings bundle seems to be limited to simple key-values loaded and saved to the local NSUserDefaults. Is there a way to specify a custom view for this? ...

Are there iPhone Notifications for all UIResponders?

I know about these notifications on the iPhone, as you may need them to scroll a text view into place when they are obscured by the keyboard: UIKeyboardWillShowNotification UIKeyboardDidShowNotification UIKeyboardWillHideNotification UIKeyboardDidHideNotification Right now, I have a some value that I want to update each time the user...

How can I prevent UITextfield font size from becoming smaller as you type

I have initialized a text box to have font size 16. Now I have noticed that as I type beyond the boundary of the text box, iPhone decreases the font size and then scrolls. Now If I delete everything from the text box and start typing, it starts with the small font and never becomes 16. Could you let me know how can I fix this? Can I init...

In UIKit, how to detect when a UISlider has stopped moving but has not been released

I have a sound effect that I want to only play when the slider is moving. Currently I have the playSound method fire when the UISlider is sending Value Changed events. I need a way to detect when the slider is not being moved, yet hasn't been released. I think I can use the Control Events of it's super class to work out the timing but...

uibutton title alignment and multiline support

How do I set the title of a UIButton to be left aligned and, how can I show multiple lines of text in a UIButton? thanks and regards, raju. ...

Persistent data between views

So I've read most of the Jeff LaMarche book, and I still can't seem to understand this... How do I persist data between various views? For instance, with a standard 'Utility Application' template, I want to be able to share variables between the frontside and the flipside... How to do? (I also want to write those variables to disk so t...