iphone

UINavigationController navigation stack problems in Landscape Mode

I have a iPhone application that I am currently converting to a Universal Binary to work with the iPad. I have successfully implemented everything I need in terms of layout so that full landscape functionality is now supported in my app (previously I primarily used portrait mode to display content). But, I have one strange problem, and ...

iPhone OpenGL ES freezes for no reason

Hi, I'm quite new to iPhone OpenGL ES, and I'm really stuck. I was trying to implement shadow mapping on iPhone, and I allocated two 512*1024*32bit textures for the shadow map and the diffuse map respectively. The problem is that my application started to freeze and reboot the device after I added the shadow map allocation part to the co...

Core Data and NSDate

Hi ! I read this post but I don't really understand the code... I have a core data database with an Entity and some attributes. One of them is named "myDate" and has for type NSDate. Now I want to to display each date but eliminate dates with same day-month-year and display them ascendantly . Have you got an idea? Thanks a lot ! ...

Can a View Controller manage more than 1 nib based view?

I have a VC controlling a screen of content that has 2 modes; a normal mode and an edit mode. Can I create a single VC with 2 views, each from separate nibs? In many situations on the iphone, you have a VC which controls an associated view. Then on a button press or other event, a new VC is loaded and its view becomes the top level vie...

OpenGL ES Highlighting Algorithm for the iPhone

Hey Everyone, I am trying to do a highlighting action on the iPhone. I can draw lines an such with the finger but now I want to be able to highlight over that. Any algorithms out there you can point me to that does that? Using OpenGL ES off course. Thanks ...

Cocos2D : How to detect that I moved a sprite in a specific zone ?

hi there, 2 things I'd like to do with cocos2D : 1) set a random board based on 6 png files (like a 6 tiles boardgame) 2) be able to move a sprite/pawn with my finger and detect on which tile the sprite/pawn was moved and trigger a specific action depending upon which tile is under my sprite/pawn... any code examples ??? cheers, Tibi...

Is it possible to update the application icon on the iphone programmatically

I've noticed that the icon belonging to the Calendar app on the iPhone updates to show the latest day. Is there anything in the SDK that will let me do this in my apps? ...

Best practices for packaging resources (jpg's, sound, video) in an iPhone app?

I'm a newb iPhone developer writing an app that has several large JPGs and sound files. Everything works ok if I drag these non-code resources into my project. But I am wondering if this is the right way to package my app. In Windows development, I would create a "resource DLL" that keeps the .exe size small. What is the equivalent for...

How can I get the first element in an NSDictionary?

I have an array of NSDictionaries. How can I pull out the first element in the dictionary? NSArray *messages = [[results objectForKey:@"messages"] valueForKey:@"message"]; for (NSDictionary *message in messages) { STObject *mySTObject = [[STObject alloc] init]; mySTObject.stID = [message valueForKey:@...

How to access Hudson CI from a mobile device like the iPhone or iPad ?

Hi Everybody, I really like Hudson CI and I do think it is the most useful and effective piece of software ever made for the Agile Application Lifecycle :-) Anyway if the CI become unstable, the development is going to be really compromised, so keeping an eye on it is CRUCIAL ! Does anybody know about an effective solution for always m...

Customize iPhone view for iPad

I have converted a very simple iPhone app to Universal app. Now I need to customize the view on the iPad to use a higher resolution image for the background, move and resize some labels, etc. How can I do it without changing the iPhone version? I can see that there is a new MainWindow-iPad.xib, but when I open in IB, it looks empty. Th...

coredata using old file version on device

This is a follow on from my previous problems here. Resetting the simulator solved all my troubles before, and I've gone on to complete my App. I now have the exact same problem when installing the app onto my iPhone device. It picks up an old version of my database, which doesn't have the second entity in it, and crashes when I try to ...

Why aren't Admob click callback delegate methods getting called?

I'm integrating the latest version of the admob sdk (version 20100412) into my app. The ads get displayed, but I need the app to make some changes when an ad is clicked and admob displays a full-screen browser. However, none of the callback methods (willPresentFullScreenModal, didPresentFullScreenModal, willDismissFullScreenModal, and d...

Xcode Obj-C: Make new NSArray from one key each out of an Array of Dictionaries

This actually could be a multipart question. But here's the first part ... I have an array (actually in a plist) of dictionaries. Each dictionary has 3 keys in it: (title), (points), and (description). I am trying to make a NEW array with the values of the key "title" from each dictionary in that first array. Let me explain WHY I a...

Learning using layers and CoreAnimation for iphone

Except for the official docs, what is a good resource for learning how to use CALayers and Core Animation correclty? ...

UITextField with numbers and default keyboard

Created a UITextField for "Postal Code/ZIP" field with a keyboardType of UIKeyboardTypeDefault. I would like to use the default keyboard but want the numbers & symbols to be shown by default as apposed to letters. Apple does this when you are entering addresses in the Contacts.app. Anyone know how to get this accomplished? ...

uniimageview not updating after views tranistion

Hi I have one main view where I display an image, in the method viewDidLoad: ballRect = CGRectMake(posBallX, 144, 32.0f, 32.0f); theBall = [[UIImageView alloc] initWithFrame:ballRect]; [theBall setImage:[UIImage imageNamed:@"ball.png"]]; [self.view addSubview:theBall]; [laPalla release]; Obviously, the value of posBallX is defined...

Black border corners when rotating iPhone

My app is landscape and returns true only for UIInterfaceOrientationLandscapeRight in the root view controller's shouldAutorotateToInterfaceOrientation call. However when I rotate the device to portrait and back, I sometime see black corners rotate through as if a thick black frame around the display is rotating and just visible on the...

How to compensate the flipped coordinate system of core graphics for easy drawing?

It's really a pain, but always when I draw an UIImage in -drawRect:, it's upside-down. When I flip the coordinates, the image draws correctly, but at the cost of all other CG functions drawing "wrong" (flipped). What's your strategy when you have to draw images and other things? Is there any rule of thumb how to not get stuck in this p...

Shake to open view modally

Hi, I have my 'shake' working fine (using motionEnded), based off of Apple's GLPaint code. When the user shakes the device (running 3.0 and up) I want to open a view controller modally using presentModalViewController. In my appdelegate I have the notification (as per the GLPaint sample code): [[NSNotificationCenter defaultCenter] ad...