iphone

How do I manually call a UIView's touch event on the iPhone?

How do I manually touch a UIView means programattically. I want to touch a view inside a UIScrollView touch manually. Any idea how to do this? Or how do I manually call UIScrollView's scrollViewWillBeginDecelerating? ...

iPhone: how to draw text in a window?

Hello. Strange situation - examples from apple works, but after i change them a bit, text is not displayed. This bit of code correctly draws blue background but refuses to draw text on it no matter what i do: #import <UIKit/UIKit.h> @interface CWnd : UIWindow @end @implementation CWnd - (void) drawRect : (CGRect) i_poRect { // This...

Iphone Dev: Adding two UITableViews in the same UIScrollView

Hey, We have a situation where we are trying to add two UITableViews inside a single UIScrollView. This seemed to be working (the two UITableViews are displayed properly) BUT 1) the data in the second UITableView is always the same as the data in the first one 2) when clicking items in the second UITableView, we get an exception: "unrec...

UIButton title and image alignment query

I have a UIButton and I am trying to set a title and an image on it. I would like to align the title for a UIButton to the left side and place an image aligned to the right. I am trying to get the look and feel of the button in Timer in Clocks app (the one which says "When Timer Ends"). I fiddled with contentHorizontalAlignment, conten...

Weird UITableView behavior after scrolling and inserting new row

This is really driving me crazy. I have a table view that displays a sorted list of customers. Users can add a new customer, thus I have to add a new row to the table view (by updating the data model and calling insertRowsAtIndexPaths:withRowAnimation:). However, since the table view is sorted, this insert can occur off-screen, which is...

Detecting when modal view has been displayed

This is a fun one... I have an application that has a help screen and is displayed as a modal view. The main view has an action that occurs when the device is shaken. I do not want the action to occur (sounds are played) when the help screen has been displayed. I have tried a few things... here is my code: To display the help screen...

Positioning elements in 2D space with OpenGL ES

In my spare time I like to play around with game development on the iPhone with OpenGL ES. I'm throwing together a small 2D side-scroller demo for fun, and I'm relatively new to OpenGL, and I wanted to get some more experienced developers' input on this. So here is my question: does it make sense to specify the vertices of each 2D eleme...

MKMapView linker error

Hi, I have upgraded my iphone sdk from 2.2.1 to 3.0. I downloaded a sample code for MapKit and was able to run it successfully. But when I tried to write my own program I faced linker errors. The error is not thrown when I import MapKit/MapKit.h or when I declare a variable as MKMapView *mapView; I get the error when I say [[MKMapView ...

iPhone SDK - TableSearch - Search all words instead of only the first one.

Hello all, I'm playing with the TableSearch sample application from Apple. In their application, they have an array with Apple products. There is one row with "iPod touch". When searching for "touch", no results are displayed. Can someone help me making all the words in each row searchable? So that results are found when searching fo...

How should I have my game entities knowledgeable of the things around them?

Every enemy type in my game is a different class, and the instances are stored in a C array. In the main game loop update() is run for each enemy/item instance, and draw() is run. Some of the update() commands require knowledge of where the main player is. What would be the best route to get that information to the instance? I don't thin...

Copy from a UITextView without having the keyboard showing

I display a UITextView that I want the user to be able to copy from but not edit. There must be no keyboard present on the screen during the copy. If I prevent first responder then the keyboard stays hidden. However this also prevents processing of events from touches that would allow a copy interaction. It also has to be editable to pr...

iPhone: scroll table view cell to visible above custom keyboard-aligned toolbar?

I've been asking a question or two over the past few days of working on an application that keeps a custom toolbar aligned to the top of the iPhone keyboard. I'm using the method described by Josh in this question; basically, I have the view controller listen for the UIKeyboardWillShowNotification and add the toolbar as necessary. The v...

Determining the number of decimal numbers for a currency

On the iPhone: Using the US locale, a currency looks like this: $1,234.56 Using the UK locale, a currency looks like this: £1,234.56 Using the German (Germany) locale, a currency looks like this: 1.234,56 € and finally, a Japanese currency: ¥1,234 The Japanese currency has no decimals and this impacts my custom keyboard significantl...

Should I use the Data Persistence API or flat files to record GPS data on the iPhone?

I'm building a GPS recorder app for the iPhone, and I was wondering if anyone could say why I might use the data persistence API, instead of writing data to flat files? ...

How to make spheres rotate in bullet3d

I am using the FallingCubes demo in Bullet3D and noticed that the cubes rotate when they collide. However when I change the program to use spheres (btSphereShape), they do not rotate. Note that I am using the iphone sdk for this. Does anyone have any advice on how to get these spheres to rotate? Here is some of the relevant code: bt...

Is there something like Matlab's eval statement in Objective-C 2.0?

I am new to Objective-C and I am looking for an eval statement like I have used in Matlab. If you are not familiar with this, you can build a character string and then eval that string, which treats it like it is a line of code. Here is a example where you would want to change the background color of one of a series of 4 buttons base...

Don't see Code Signing Entitlements in xcode target properties

I am trying to build an adhoc build for my app , I am following the instructions on the apple's documentation which says Select the Target and open the Build settings inspector. In the ‘Code Signing Entitlements’ build setting, type in the filename of the new Entitlements.plist file including the extension. There is no nee...

Customizing the "More" list of UITabBarController tabs

I am writing an App based on UITabBarController which has more than 10 viewControllers with corresponding UINavigationControllers. Each viewContoller has a (short) Title and a (long) navigationTitle. The short title shows up under the TabBar icon and the long title shows up on top of the navigation bar. The UITabBarController displays t...

IPHONE: ABPeoplePickerNavigationController hidden navigation bar

Hello I have a ABPeoplePickerNavigationController, on creation is set its navigationBar hidden. peoplePickerController.navigationBar.hidden = YES; This works perfectly, the only problem is that when the user taps the search box to search for a person, as he return's from the search, the navigationBar is re-displayed,. How can I get no...

commitEditingStyle method not firing?

I have a tableView that I want to allow editing and delete rows. I make it go into editing mode fine. But when I press the delete button it's not firing off the event to make it delete the row!?? Here is my code: - (IBAction)editTable:(id)sender{ ; if(self.editing){ [super setEditing:NO animated:NO]; [self.tableView setEditing:NO an...