cocoa-touch

UIEvent passed into -[UIView hitTest:]

I'm overriding the -hitTest: method in a custom UIWebView subclass. The UIEvent that gets passed to this method always has an empty set of touches ( [[event allTouches] count] is == 0 ). Shouldn't there be touch information in the UIEvent object or is this a bug? I've tried other UIVIew types (e.g. UIView, UIWindow) and see the same beh...

NSString property: copy or retain?

Let's say I have a class called SomeClass with a string property name: @interface SomeClass : NSObject { NSString* name; } @property (nonatomic, retain) NSString* name; @end I understand that name may be assigned a NSMutableString in which case this may lead to errant behavior. For strings in general, is it always a good idea...

NSSound on the iphone

I've been looking for a while how to play sound on the iphone, and I think it's something along the lines of: [[NSSound soundNamed:@"cat.mp3"] play]; But the NSSound is on the AppKit ... any suggestions ? I know there is a really simple answer to this, but today my searches are not rendering any result ... ...

Getting the Value of a UITextField as keystrokes are entered?

Let's say I have the following code: IBOutlet UITextField* nameTextField; IBOutlet UILabel* greetingLabel; I'd like the greetingLabel to read "Hello [nameTextField]" as soon as the user presses any key. What I need basically is the iPhone equivalent of the Cocoa delegate method -controlTextDidChange: The -textField:shouldChangeChar...

What is the fastest way to draw single pixels directly to the screen in an iPhone application?

I am looking the fastest way to draw thousands of individually calculated pixels directly to the screen in an iPhone application that preforms extremely well. ...

How to get the size of a scaled UIImage in UIImageView?

The image.size attribute of UIImageView gives the size of the original UIImage. I would like to find out the size of the autoscaled image when it is put in the UIImageView (typically smaller than the original). For example, I have the image set to Aspect Fit. Now I want to know its new height and width on the screen so I can draw accur...

UITextField - clearButtonMode only in code, not in IB?

Is there anyway possible to set the clearButtonMode for a UITextField in Interface Builder? Is this only possible to do code? I do not see it as an option in the UITextField attributes panel. ...

UITableView into a UIScrollView?

I'm looking to have two views which are part of a constituent set. Data in each view would be best represented in a UITableView. I'd like to then add a gesture to flicker the view off screen and have another similar view brought in, with a page indicator control. My fear is that UITableView intercepts touches and becomes the responder to...

User Interface inspiration for iPhone Apps

Does anyone have any suggestions for a site that potentially has some inspirational user interfaces for building my own iPhone Apps. It's straight forward to continually build out applications with the conventional UIKit widgets, but it does not set you apart from the competition. Some resources on how to build attractive interfaces is h...

Dismiss iphone keyboard

I am trying to recreate something similar to the popup keyboard used in safari. I am able to visually reproduce it by placeing a toolbar over my view and the appropriate buttons, however i cant figure out any way to dismiss the keyboard once the user has touched the done button. ...

Adding a subview below my UITableView

I'm experimenting with programmatically adding a subview below my UITableView. I'm using a map curl sample from Erica Sadun's book in order to test to see if the view below my UITableView is indeed the view I'm adding. However, when the UITableView curls up, the view color of the view below is white, not the black view I'm adding in the ...

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController loadView] loaded the nib but no view was set.

From what I understand of the SDK, this exception is raised when the bindings in IB are not proper. But in my case, the view is loaded fine for the first two times. I then move back from the view using the NavigationController. The third time when I try to open the view, I get this exception. The fact that it opens correct the first two...

For iphone development, how to flip a UIImageView?

I want to flip an imageView (left/right), but I can not find a UIView (or UIImageView) method to do that? any idea? thanks! ...

Finding when the ActiveApplication changes in OSX through Python...

Is there a way to find when the activeApplication changes in OSX through Python and AppKit? I know how to find out launchedApplication and activeApplication ( please refer to my other question here: http://stackoverflow.com/questions/373020/finding-the-current-active-window-in-mac-os-x-using-python ) ...

Best Practice: Animating a view into display onto iPhone

If I'm looking to use Core Animation to fade a view in and out of display -- is it good practice to have the UIView in the same NIB as the view that it is being drawn into? Should I build the view in another NIB file and load it in from there? I'm looking to animate three small views into display simultaneously upon a user action. I want...

Bindings using Interface Builder (for iPhone apps)

How does one bind an iPhone SDK control (say a UISlider) using Interface Builder? Unlike regular Cocoa applications, the bindings tab does not seem to be present when the iPhone-app XIB is opened using Interface Builder ...

Seems like it should be easy: Landscape Scrolling Text Field

I have a application that I am working on that is in landscape mode and does not rotate. However I can not get the text field to rotate. I have been putting in way to many hours so don't be to harsh if this is a easy answer... ...

Blocks to KB/MB/GB from statfs on iPhone

I am using statfs() which gives me the free blocks available to a non-superuser. I am unsure how to convert this into KB/MB/GB. The values that are returned are: fundamental file system block size: 4096 total data blocks in file system: 3805452 free blocks in fs: 63425 free blocks avail to non-superuser: 63425 total file nodes in file...

How to show real-time suggestions (e.g. existing entries with same initial characters) while user is typing in a text field in Cocoa Touch?

I'm wondering if there is an existing class or library code in Cocoa Touch that shows the user a list of real-time suggestions while they are entering text input, with the suggestions based on similarities between what they have already entered and previous entries. For instance, see how Safari on the iPod Touch shows realtime suggestio...

Using a UIImage as the application icon

Is possible to set an image as an iPhone application unique icon in code instead of adding a PNG format image file and naming it Icon.png? ...