iphone

how to change the orientation of a view controller for specific view

I have following requirement in my application. A tableView with games title After selecting a game / cell A detail view appears when user presses on a button to see the huge image from detail screen, it should push another view a new pushed view should be displayed in landscape mode All previous view should be in portrait mode & onl...

Media Player MPMediaItemArtwork Memory Leak

Hello, I seem to be getting a memory leak when getting the album artwork for the currently playing item with this code: MPMediaItem *playingItem = self.musicPlayer.nowPlayingItem; MPMediaItemArtwork *artwork = [playingItem valueForProperty:MPMediaItemPropertyArtwork]; I have tried [artwork release]; even though I didn't alloc artwork...

Display OBJ export vertices

Hi, I've created simple 3d polygon models in Blender, and exported them as OBJ format. I've pasted the resulting vertice arrays into my code, setup the vertex array and vertex pointer, enabled depth testing, etc. When I draw using glDrawArrays(), I see a bunch of faces that only vaguely resembles mo OBJ model. I've tried using blender...

Compile Arm Assembly directly in XCode

What is the best way to go about compiling arm assembly code into xcode. I have those assembly files which are generated. Is there a way i can just include the .s file directly into the c code that i have. Or i will need to run an preprocessor first which would generate the .o file which i can link with my files. If that is the case, how...

italic, bold and underlined font on iPhone

How do you set a font to be both bold and italic. There is a boldSystemFontOfSize and italicSystemFoneOfSize, but I can't see the way to set a font to be both italic and bold. As a second question, is there a way to set an underline on a font, or do you simply draw a line under text. ...

Is there a portable OpenGL UI Library (Buttons, Lists, Windows, Dropdown etc)?

I'm searching for a OpenGL User Interface Library like WxWidgets but not OS dependent. It would have to provide callbacks for user input since this is OS dependent. If something like this doesn't yet exist (which I doubt because most games have most of the Basic UI Elements) is there a OpenGL HTML/CSS renderer? ...

How can I optimize drawing of multiple fullscreen transparent iPhone OpenGL ES layers?

Hi, I'm trying to optimize my iPhone OpenGL ES app. This is based on the GLSprite and GLPaint sample apps. I've factored out EAGLView into a base class, and I'm subclassing it in 3 different OpenGL views to make 3 transparent layers. The display parent for the 3 EAGLViews is a UIView, and that UIView is a child of the UIWindow. I'm...

iphone fetchRequest sub entities?

If i fetch data from "parent" and assign it to a fetchresultscontroller, i still have to call [parent.images allObjects] in my cellForRowAtIndexPath to get to the child data. Is this a normal thing to do or can i get the real data from child right in my fetchedresultscontroller? ...

Using custom sections with NSFetchedResultsController?

I'm making a sectioned table with fetched results, but am having a hard time getting custom sections worked out. Normally one would just have an attribute to sort by, and use sectionNameKeyPath: to generate the sections. But my sorting attribute is calculated on the fly, and I can't seem to get the fetchedResultsController to use it cor...

NSString text pixel length

How to know how much pixels my text is taking in a UILabel ? I want to insert a small picture in between text. Can be usefull to adjust my label width. ...

path of uncompressed video on iPhone 3GS

I want to know if iPhone SDK and OS 3.1 provide access to the original uncompressed video to the applications. I basically am writing the application in which one of the functionality requires access to original uncompressed video for sharing purposes. Any help is appreciated. ...

No effect of reordering sublayers

I have a UIView subclass that instantiates three sibling sublayers of its layer. Two of the sublayers have their content set to images files; and the third has a graphic drawn in the - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx method. The problem is that my drawing layer always appears behind the image layers. I...

cocos2d iphone - game architecture: physics VS. code simulated sprite behaviors

Hello stackoverflow community ! I am trying to figure out how to architect my game using cocos2d. My problem is that cocos2d's physics engine (i'm talking about chipmunk) lies in a world behind sprites. When I move the sprite, I'm wondering if I should *1) be moving it by applying forces on the physics body behind it OR 2) if i ...

Handling subview's touch events within it's parent while retaining screen coordinate data relative to window

Hi, Parent is a UIImageView, child is a UIImageView. Both have enable user interaction set to yes. Problem is that child will cover parent view, so can't fire touches from the parent, need to do them from the child. But how can the child either set a new image file in the parent based on it's touch events which can be acquired by user ...

Unable to delete rows in table using Three20

I've got a button that toggles setEditing on a TTTableView. Previously I'd been using a "regular" UITableView and the following method to actually delete the data, but I don't see anything similar in the Three20 classes and using my method doesn't get called when the delete button is pressed on a row. (void)tableView:(UITableView *)tab...

Resize cells when rotating UITableView

I have a tableview that occupies only the bottom third of my view. I rotate it 90 degrees using CGAffineTransform and resize it: [UIView beginAnimations:@"rotate" context:nil]; CGRect oldFrame = self.table.frame; CGPoint oldCentre = self.table.center; // Swap the width and height self.table.frame = CGRectMake(0.0, 0.0, oldFrame.size.he...

Substituting variables inside SUBQUERY using Fetch Request Templates

I created a Fetch Request template in the Predicate Builder in Xcode. Because there are some variables that I want to subtitute with the actual value when executing the request I am using the following method. -(void)NSManagedObjectModel fetchRequestFromTemplateWithName:substitutionVariables: My request contains a subquery and the var...

UITableView woes: Keep on getting this runtime error unrecognised selector

HI guys, I have this error that is keeping me from moving forward. I basically have an application which contains a UITabViewController which points to individual UIViewControllers. So one of the tabs, I want to implement a basic TableViewController. Now, no matter what i do, whether its cut and paste sample UIViewController code that ...

Am I supposed to be able to detect multi-finger taps this way?

This is the touchesBegan method for a view that has multiple touches enabled. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch* touch = [touches anyObject]; if ([touches count] > 1) NSLog(@"multi touches: %d fingers", [touches count]); NSUInteger numTaps = [touch tapCount]; if (numTaps...

using iPhone OpenGl ES effectively for 2d (and collision detection)

this may be a more general opengl question. using OpenGL ES for 2d, and reading through the tutorials, I learned how to do the basic matrix transformations like rotating and moving an object around the screen. so far, so good - I have some objects moving around and rotating. the next step for me is to do collision detection. someth...