iphone

Using libRocket with iOS

I'm trying to use libRocket in an iPhone application (with cocos2d), but I can't seem to get over OpenGL error 0x0500 in -[EAGLView swapBuffers]. It seems to be triggered when calling glDrawElements(GL_TRIANGLES, num_indices, GL_UNSIGNED_INT, indices); in ShellRenderInterfaceOpenGL. I had to change GL_RGB8 to GL_RGB in the GenerateText...

How to implement a Modal View in a TabBar iPhone app

I am trying to present a modal view in a tabbar app. I am using the code - (IBAction)newView { [self.viewController presentModalViewController:viewController animated:YES]; } linked to a button. When the button is pressed, nothing happens and nothing is displayed on the log. This is most likely simple to fix, but I have not found any...

Detecting Simultaneous Button Presses and other Gestures, Shakes and Tilts - Cocos2d & iPhone.

I am writing an app for the iPhone using cocos2d where I have 4 Sprites that are buttons. I want to allow and respond to the following (allowing the user 3 seconds to apply his input before timing out): -- Single button presses (I have this part working). -- Pressing of more than 1 button at at the same time (each combination would have...

How can I measure the time it takes to perform a method?

How can I measure the time it takes to perform a method call? I would like to know in order to time my delays properly. I'd appreciate any help you guys could give me. //Start measuring here [self method]; //Stop measuring here ...

XCode: Cannot change target membership for folders

I have a number of folders in my Resources group. I want to include some of them in target A and some in target B. To this end I created two subfolders: Resources - content -- A -- B If I try to change target membership for 'content' I can, under 'Get Info', select the targets. If I try the same for 'A' and 'B', under the 'Targets'...

How to insert a subview with xib?

Hello! I'm confused something fierce over having multiple views. I simply want to have a button on my main view that activates a new view, which in turn would have an (x) button which goes back to main view. For the life of me, I can't figure out how to do this with two separate .xib files. How might this be done? Thanks! ...

iPhone Recalculate Scroller Content Height?

I am adding a bunch of boxes into a UIView inside of a UIScrollerView. The content of the UIView goes beyond the bottom of the device's screen and should cause the whole scene to scroll. However, this isn't happening. The content gets added but the scene will not scroll. I assume it has to do with UIKit not automatically resizing the UI...

Iphone - CGPointIntersectsRect Collision Problem???

The problem is when the player collides with the blackB the player doesn't stop. It slowly continues through the blackB. The IBAction is being used with a game loop. I need a way to freeze the player completely when it collides with the blackB. Any help is welcome, I am a beginner programmer. Thank you! player and blackB are both UIImag...

store (x, y) positions in some output file using Xcode for iPhone?

Hello, I want to program an application on iPhone and I want to know if the idea of this application is doable. So in the Application I want to have an image that appears to the users (this is easy. When the user touches the image, the application records the (x,y) position of where the user touches exactly in the image and stores it in ...

Automatically center a UIImageView after rotation

Hello I have an UIImage inside an UIImageView in my application. In portrait mode, the image is centered but when I switch to the landscape mode it stills on the left. So I added the following method in my .m file but the problem is that I have a TabBar application, so when I rotate the device on another tab and I go back to the tab c...

Multi-touch detecting & differentiating - Cocos2d for iPhone

I would like to know how to detect and differentiate between touches in a multi-touch view. I have read about a "hash" code, but I don't understand how to use it. I want to know when two of my Sprites are touched at the same time, like as if pressing a chord on two keys of a piano. [EDIT] Here is an example of what I have for my ccTou...

when is the right time to reloadData

I have a DetailsViewController class and an ItemsViewController class. (Both derived from UITableViewController) Selecting any of the items in the ItemsViewController brings up the DetailsViewController. In order to get it to show the new data on any but the first one, I currently have - (void)viewWillAppear:(BOOL)animated { [s...

Does CGContextRotateCTM rotate on different rotational speeds on simulator and device?

I have a project where it rotates 2 spindles 360 degrees both at different speeds over time. I have noticed that it runs well on simulator but when I test it on a device it is significantly slower. The timing taken to make the first 3 full rotations on the simulator and the device are: On Simulator: 7.0, 7.2, 7.2 On Device: 19.3, 19.5,...

Storing UITextField contents before view pops

I am sure this is in the Apple documentation or must have been answered somewhere on this forum, since it seems so basic, but I could not find it nor a particularly elegant solution myself. What I have is a UIViewController that pushes an editing view on its navigation stack. The editing view has a bunch of UITextFields in it. If one ...

Can I pause a loop while waiting for delayed methods to finish?

By delaying method calls inside a loop I noticed that the loop still runs, instead of waiting for the methods to complete. How can I get the loop to wait for the delayed methods to finish before continuing on to the next iteration? I'm delaying the methods by using the three calls below, for (int i = 0; i < [phrase length]; i++) { //D...

It it possible let Navigationtroller not to display full screen?

Hello everyone I have an UIView (320*300 the view of an UIViewController), I hope to display UINaviationCotroller and control the navigation within this view size. Is it possible? Thanks interdev ...

Suitable Advanced iPhone/iOS development course material?

There seem to be a lot of introductory books, courses and bootcamps for iPhone development, covering the basics of Xcode, Objective C, Foundation, UIControls, UITableViews, etc. What would be the most appropriate course material set for the next more advanced iPhone development class, suitable for and of interest to the widest percent...

When I set the availability of my app for a future date does it still retain a "new" status

I know this isn't a programming question, but since a lot of people here are iPhone developers i'll ask anyways. My iPhone app got approved at around 11:30PM last night, and today I decided to download it to check it out. I noticed that there was a little problem with the app so I decided to change the availability date to a later date,...

iphone access orkut api

Does anybody know a code sample for accessing the orkut API thought the iPhone SDK? I only found this java version http://code.google.com/p/orkut-os-client/ that's no good for me. Thanks ...

Animated transition between UIViewController and EAGLView

My iPhone app has two main "views": a UIViewController with some buttons, text etc and a window where all the OpenGL ES stuff happens. When I transition from the UIViewController to the window (when the user clicks "play" for example) I just do: [window ExchangeSubviewAtIndex:0 withSubviewAtIndex:1]; Perhaps this is not the ideal wa...