cocoa-touch

sliding UISearchBar

Hi, I would like to hide the UISearchBar most of the time and only call it to appear when user wants it. I've put a UISearchBar in Interface Builder and hide it behind a view, when user click a button, it calls the following code, which I hoped it would bring the search bar to the front and slide the keyboard to view. But it doesn't.....

Changing the background color of a UILabel within a UITableViewCell

A UITableViewCell comes "pre-built" with a UILabel as its one and only subview after you've init'ed it. I'd really like to change the background color of said label, but no matter what I do the color does not change. The code in question: UILabel* label = (UILabel*)[cell.contentView.subviews objectAtIndex:0]; label.textColor = [UIColor ...

Using a UITableViewController with a small-sized table?

When using a UITableViewController, the initWithStyle: method automatically creates the underlying UITableView with - according to the documentation - "the correct dimensions". My problem is that these "correct dimensions" seem 320x460 (the iPhone's screen size), but I'm pushing this TableView/Controller pair into a UINavigationControll...

Can I use -selectRowAtIndexPath: (or anything else) on a UITableView to trigger delegated -didSelectRowAtIndexPath: method?

I have a UITableView set up as a navigation controller type deal (like the default in Xcode). I have added an "Add" button which adds an element to the UITableView. When I call -selectRowAtIndexPath: on this new row I just added, it will highlight the row, but the next view is not pushed onto the stack. I assume this is because -selectRo...

Set Appointment using iPhone SDK

I know you can access the Contact Store from the SDk, but is it possible to create and read appointment data? ...

Repeating background image in native iPhone app

Short of putting a UIWebView as the back-most layer in my nib file, how can I add a repeating background image to an iPhone app (like the corduroy look in the background of a grouped UITableView)? Do I need to create an image that's the size of the iPhone's screen and manually repeat it using copy and paste? ...

How do you move a CALayer instantly (w/o animation)

I'm trying to drag a CALayer in an iPhone app. As soon as I change its position property it tries to animate to the new position and flickers all over the place: layer.position = CGPointMake(x, y) How can I move CALayers instantly? I can't seem to get my head around the Core Animation API on the iPhone. Thanks a lot.. ...

Is it possible to remove the "cancel" button in UIImagePickerController?

I have a UIImagePickerController as one view in a TabBar setup. Is it possible to tell the UIImagePickerController to not show the Cancel button in the top navigation bar when browsing photos libraries? ...

After Animation, View position resets

I am trying to make a view slide from top to bottom. This is not a big deal, I used CABasicAnimation for this. The problem is when I want to remove the view. I use this animation. CABasicAnimation *animation; animation = [CABasicAnimation animationWithKeyPath:@"position"]; [animation setDelegate:self]; animation.toValue = [NSValue value...

Need a good way to share iPhone source code on the Web.

Hi, I'm looking for a way to share some iPhone SDK source code I have with others. Goals: Share iPhone SDK source code, Objective C written in XCode. I have a good bit of source code I want to share. I'd like for it to be easy. I'd like for it to have syntax highlighting, by this I mean coloring and formatting Ideally it would allow m...

Manually drawing a gradient in iPhone apps?

If I have two UIColors, what's the best way to draw an even gradient between them over an arbitrarily-sized area? I am guessing you would create a UIView subclass and use the CG drawing methods in the drawRect method. I just don't know which ones, or if there are any pitfalls to watch out for, like performance. Has anyone done this? ...

Creating a left-arrow button (like UINavigationBar's "back" style) on a UIToolbar

I'd love to create a "back" left-arrow-bezel button in a UIToolbar. As far as I can tell, the only way to get one of these is to leave UINavigationController at default settings and it uses one for the left bar item. But there's no way I can find to create one as a UIBarButtonItem, so I can't make one in a standard UIToolbar, even thoug...

How do I create blurred text in an iPhone view?

I am building up a view with various text and image elements. I want to display some text in the view with a blurry copy of the text behind it, but not just a text shadow. How do I apply Gaussian blurred text onto a UIImage or layer? ...

Navigation Controller Transparent Bar Style is not working

Hi, I am using a navigation controller, and I have the style set to : navController.navigationBar.barStyle = UIBarStyleBlackTranslucent; But when I run my program, the navigation controller looks like it is on top of a white background, not my background. When I push a controller, left or right, all my view, the current one, shifts to...

How do I create a simple two-screen iPhone app?

I've gone through most of the example code and I still need some help. I want to make an uber-simple app: show one screen at startup with a label and a button. click the button and we slide over to another screen (I suppose these are called views) which has another label and the "back" button in the top menu bar. I just want to click...

Referencing AppDelegate instance variables

I have a project that is based on the Navigation Based Application template. In the AppDelegate are the methods -applicationDidFinishLoading: and -applicationWillTerminate:. In those methods, I am loading and saving the application data, and storing it in an instance variable (it is actually an object-graph). When the application loads...

What are the best Cocoa-Touch/iPhone programming blogs?

What are the best Cocoa-Touch/iPhone programming blogs? One blog per answer please. Some answers may overlap with Best Cocoa/Mac OS X programming blogs? , but I'm looking for blogs with good meaty iPhone specific content (i.e. code) ...

How do I create a rounded table with controls in the cells?

I'm exploring the iPhone SDK and want to create and use a UI component like the figure below. A rounded table with cells in which each cell can have some label text, maybe an input text field and an action button that would take it to the next screen. The table should not be screen filling. But... I can't figure out how to do it or find...

Which method name fits in best with Objective-C/Cocoa conventions?

Here's a quicky question. Which method name makes the most sense for an Objective-C Cocoa application? -(void) doSomethingWithAnimation:(BOOL)animated or: -(void) doSomething:(BOOL)animated or even: -(void) doSomethingAnimated:(BOOL)animated ...

What's the UITableView index magnifying glass character?

In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark character there, but that looks lame. Can anyone tell me what ch...