cocoa-touch

Delay with touch events

We have an app in AppStore Bust~A~Spook we had an issue with. When you tap the screen we use CALayer to find the position of all the views during their animation and if you hit one we start a die sequence. However, there is a noticeable delay, it appears as if the touches are buffered and we we receive the event to late. Is there a way...

Unable to set text field on UILabel

I have created UITableCellView class called NoteCell. The header defines the following: #import <UIKit/UIKit.h> #import "Note.h" @interface NoteCell : UITableViewCell { Note *note; UILabel *noteTextLabel; } @property (nonatomic, retain) UILabel *noteTextLabel; - (Note *)note; - (void)setNote:(Note *)newNote; @end In the...

How do I show the keyboard by default in UITextView?

I want to create a view that consists solely of a UITextView. When the view is first shown, by default, I'd like the keyboard to be visible and ready for text entry. This way, the user does not have to touch the UITextView first in order to begin editing. Is this possible? I see the class has a notification called UITextViewTextDidBegin...

How do I set UITableViewCellSelectionStyle property to some custom color?

I am developing an iPhone application, in my table view I wanted custom color for Cell Selection Style, I read the UITableViewCell Class Reference but there are only three constants defined for Selection style (Blue, Gray, None). I saw one application that used a different color than those defined in the reference. How can we use a colo...

UIImage rounded corners

I try to get rounded corners on a UIImage, what I read so far, the easiest way is to use a mask images. For this I used code from TheElements iPhone Example and some image resize code I found. My problem is that resizedImage is always nil and I don't find the error... - (UIImage *)imageByScalingProportionallyToSize:(CGSize)targetSize { ...

CATransition showing a single frame from the end of the transition before the animation starts

I am using some code which was originally taken from the Apple sample ViewTransitions to swap two views with each other. CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setType:kCATransitionFade]; [animation setDuration:0.3f]; [animation setTimingFunction:[CAMediaTimingFunction functionWithNa...

iPhone OS Utility App - Flipside View and Main View communication

I am currently working on an iPhone 2.1 application. I am new to Objective C, coming from a Java background. My application has as a base the Utility Application template available in Xcode with the iPhone SDK. Currently I have some controls, such as an UISlider and text box, in the FlipsideView. The UISlider already has a method which ...

Cocoa Graphing/Plotting Framework that Works on iPhoneOS

Hello All, Looking at adding some data graphing to a new iPhone app in development (ala the Stocks app). I realize I could buckle down and do some Quartz drawing but I'm hoping that someone somewhere has a tip on a Cocoa graphing framework that works on iPhoneOS. Any suggestions? It would be a shame to re-invent the wheel if it's out ...

Converting plist to binary plist

Apple strongly recommends using the binary plist format when reading large XML-based data sets into iPhone apps. Among their reasoning is the fact that XML parsing is very taxing on the iPhone. However, this requires that files residing on the remote web server be converted first. For frequently-changing content, it is not acceptable to...

UIWebView within a ScrollView does not redraw

I have UIWebView within a UIScrollView. Then as I scroll, the web view displays first two pages correctly but does draws only half of the third the page. If I tap on the web view it draws the content or if I call -[UIWebView reload] in -scrollViewDidEndDecelerating, it shows the content. Is there any way I can make the web view draw co...

Full-screen camera

How can I make the iPhone camera full-screen by removing the overlay? Can I change the camera toolbar style? ...

What's the best way to find the user's Documents directory on an iPhone?

I'm reading Erica Sadun's iPhone Developer's Cookbook, and ran into a question. She says in the book that the way to find the user's Documents directory is with the code: [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; but that seems slightly brittle, and dissimiliar to the normal Mac way of doing it, which would be:...

Is there a better way to determine the right size for a UITableViewCell?

I have a UITableView cell that is going to have a variable size depending on it's content (potentially several lines of text). SInce it appears that heightForRowAtIndexPath is called before I layout the cell, I just guess the correct height by calling [NSString sizeWithFont] on my text string. Is there a better way to set the height af...

iPhone SDK - UIWebView has a grey box over it

Sometimes, my UIWebView will have a grey box over part or all of the content. I can't make heads or tails of why it's happening. It happens regularly for certain content. Thanks! --Update-- It seems to occur when the webview is not immediately viewable on the screen -- ie i've got a scrollview, and the webview is below the fold. --U...

How do you dismiss the keyboard when editing a UITextField

I know that I need to tell my UITextField to resign first responder when I want to dismis the keyboard, but I'm not sure how to know when the user has pressed the "Done" key on the keyboard. Is there a notification I can watch for? ...

Using default tab-controller created project... first view controller doesn't respond to addsubview

I created a project using the default tab-controller project. I am using interface builder to edit the .xib file and add images and buttons. I hook them up to the FirstViewController object in interface builder (that I created and set it's class to the same as the code file). I hooked everything up using IBoutlets and IbActions. Everyt...

Best way to generate both "free/demo" and commercial apps from the same source code?

I would like to provide two different versions of my iPhone app on the App Store -- one free that is limited by the number of items displayed through the application, and another one completely unlimited. The source code for both apps will be exactly the same, the only difference would be the SQLite database that stores the items in the...

Unicode Character Not Showing

I want to display the "infinity" symbol using CGContextSelectFont(context, "HelveticaNeue", textSize, kCGEncodingMacRoman); CGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName length]); It is displayed as a square box, or a circle. I have found...

Best way to enter numeric values with decimal points?

In my app users need to be able to enter numeric values with decimal places. The iPhone doesn't provides a keyboard that's specific for this purpose - only a number pad and a keyboard with numbers and symbols. Is there an easy way to use the latter and prevent any non-numeric input from being entered without having to regex the final re...

Custom UIView with keyboard input?

I have a custom UILabel subclass for displaying currency values. I only want the user to be able to enter digits and let the view format those digits into a currency value -- like a cash register. This makes UITextField an inappropriate choice for this kind of input. I've already overridden hitTest: so that the UILabel will return itsel...