uikit

How to add a custom background to UISearchDisplayController's table view?

I want to add a custom UIImageView to UISearchDisplayController's table view background and set table view's background color to clearColor. Tried a few different approach but couldn't find the right solution. Any idea how to approach this? Note: I don't want to add to searchDisplayController's searchResultsTableView's view hierarchy,...

NSZombieEnabled doesn't report the type of object causing an EXC_BAD_ACCESS error

I have a crash that is happening deep within UIKit for some reason; an EXC_BAD_ACCESS error is happening something like 8 calls deep into a dismissModalViewController call. I tried enabling NSZombieEnabled for my executable, but the console log prints the same error regardless of whether or not zombies are turned on and i don't know whi...

Objective-C use typedef enum to set Class behavior, like Cocoa.

Hi Im extending the UIButton Class to be able to set the font and color of the UINavigationBarButton ( from this code example: switch on the code ) I goes like this: @interface NavBarButtonGrey : UIButton -(id)init; @end @implementation NavBarButtonGrey -(id)init { if(self = [super init]) { self.frame = CGRectMake(0, 0, 49.0,...

Objective-C Protocols within Protocols

I recently began trying my hand at using protocols in my Objective-C development as an (obvious) means of delegating tasks more appropriately among my classes. I completely understand the basic notion of protocols and how they work. However, I came across a roadblock when trying to create a custom protocol that in turn implements another...

iphone MFMailComposeViewController

Hi, Is there a way to dismiss the keyboard from MFMailComposeViewController ? If the user rotates the device, I am loading a separate controller without "send" or "cancel" being pressed, and the keyboard is remaining on screen. Is there an way to dismiss the keyboard without "done" or "send" being pressed? Thanks in advanced guys and g...

How can I show a sequence of buttons highlighting?

Similar to the Simon games of old, I want to show the user a button sequence & then have them repeat it back. The place I'm stuck is showing the first button highlighted for, say, 500ms, waiting 100ms, showing the second highlighted for 500ms, waiting another 100ms, showing the 3rd & so on. From other Stackoverflower'ers I've gotten to...

UIImage view questions

I have a UIImageview in my application and I was wondering how I can show an image in it pragmatically and change it whenever I want to! I think my major problem is exactly WHERE to put it! If you could show me what code and where that would be very usefull! thanks! EDIT: Also if you can pragmatically change the background into an image...

Toolbar items in sub-nib

This question has probably been asked before, but my google-fu must be inferior to everybody else's, cause I can't figure this out. I'm playing around with the iPhone SDK, and I'm building a concept app I've been thinking about. If we have a look at the skeleton generated with a navigation based app, the MainWindow.xib contains a naviga...

Writing a masked image to disk as a PNG file

Basically I'm downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I'm using the masking code everyone seems to point at which can be found here: http://iphonedevelopertips.com/cocoa/how-to-mask-an-image.html What happens though, is that the image displays fine, but the version...

how does one make a subview firstResponder

i am trying to get a subview to become firstResponder. my understanding is that this is done in its viewDidAppear method, like so: - (void)viewDidAppear { [self becomeFirstResponder]; } while overriding canBecomeFirstResponder to return YES: - (BOOL)canBecomeFirstResponder { return YES; } however, when i insert the subview ...

why does viewDidAppear not get triggered?

i have a root view controller that inserts a subview at index 0 at its viewDidLoad method. i am trying to get the subview to become firstResponder, but can only do this - from my understanding - in the subview's viewDidAppear method. here's the line of code i added to the root view controller's viewDidLoad method: [self.view inse...

How do you create UIBarButtonItems with a radio interface?

I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up radio UIBarButtonItems in the class reference definition of the width property: If this property value is positive, the width of the co...

How should I do to pop all or Specific Number viewsController?

[self.navigationController popViewControllerAnimated:YES]; This code is to pop only one viewController. How should I do to pop all or Specific Number viewsController? ...

iPhone Keyboard Shift state: how to control it?

Hi all, Sorry if my question if a dumb one, but I couldn't find a way to solve it. The thing is a have a custom text view that sometimes need to wrap text according to its own rules. Everything works just fine with static content, but if I insert a @"\n" as the user starts to write another word (I know the word he's going to type and I ...

How to set/corrent the resting position of UIScrollView contents after it has scrolled.

I am implementing a view similar to a Table View which contains rows of data. What I am trying to do is that after scrolling, each row snaps to a set of correct positions so the boundaries of the top and bottom row are completely visible - and not trimmed as it normally happens. Is there a way to get the scroll destination before the sc...

UIImageView - How to get the file name of the image assigned?

Is it possible to read the name of an UIImageView's image that's presently stored in the ImageView? I was hoping you could do something kind of like this, but haven't figured it out. NSString *currentImageName = [MyIImageView getFileName]; ...

When is the right time to change the datasource for a UITableViewController

After rendering a UITableView with a given datasource, I want to be able to switch to a different one prior to calling reloadData. Tried doing it in the method - (void)viewDidAppear:(BOOL)animated; but as far as I can see this isn't called when all the visible cells are rendered. By placing a breakpoint it seems as if nothing is act...

UINavigationBar with a static image

Adding an image to a UINavigationItem's titleView is pretty trivial, but when I push a new view on the stack it animates the UINavigationItem sliding off to the left, along with the titleView, and loads a new UINavigationItem. I can think of a number of ways to go about making that image stay put, but they all seem pretty hacky. Is the...

sending text messages in iphone programmatically

Hi all, Is it possible to send text messages using iphone programmatically ? I think its not possilbe, its more like sending SMS programmatically. Are there any web service or api available for this ? Any suggestions ? thanks ...

How to read contacts from addressbook in a tableview ?

Anyone knows how to read all contacts from address book and show it in a tableview in the main screen ? ...