cocoa-touch

iPhone Video API. Is frame by frame control possible.

I would like to do the following on iPhone/iPodTouch: Open a video and - via swipe or tilt - use gesture to move through each frame. Think of it as a gestural flipbook. Does the video API support seeking frame by frame in this manner? Thanks, Doug ...

Linking two UIScrollViews so they follow each others touches

I want to make a list, that is divided in 2 parts, left and right. The left part can only scroll vertically (has a list in it). The right part scrolls vertically, and horizontally.. So, I want a control that has a list on the left side, and a view on the right side, both detect scrolls. But the left part always stays on the screen, and ...

How to fix an 'Object' may not respond to 'method' warning in Cocos2d.

In cocos2d, I'm trying to call a method on the Parent of a CocosNode. The app works fine, but I get an 'Object' may not respond to 'method' warning. The parent is a subclassed Cocos2d layer, so I'm guessing I need to cast parent somehow, but that generates fatal errors. The method is like this if(CGRectContainsPoint([newBrick boundingB...

nsxmlparser not solving '

Hi! Im using NSXMLParser to dissect a xml package, I'm receiving &apos inside the package text. I have the following defined for the xmlParser: [xmlParser setShouldResolveExternalEntities: YES]; The following method is never called - (void)parser:(NSXMLParser *)parser foundExternalEntityDeclarationWithName:(NSString *)entityName pu...

Navigation & View Controller questions

I'm experimenting with ViewControllers & NavigationControllers in Interface Builder trying to get a better grasp of what's tied to what and why... I'm struggling with a scenario that has confused me. Hopefully someone can set me straight... Say I start with your typical iPhone template View-Based Application and I display a view which i...

Catch a subview touch event

I have a UIViewController, and I've added two subviews to its view. One subview is the view of a UIViewController. The other subview is a UITextField. I need to dismiss the keyboard for the UITextField when the user touches the other view, but I can't figure out how to detect those events. The UIViewController's tableView catches the...

How to optimize Core Data query for full text search

Can I optimize a Core Data query when searching for matching words in a text? (This question also pertains to the wisdom of custom SQL versus Core Data on an iPhone.) I'm working on a new (iPhone) app that is a handheld reference tool for a scientific database. The main interface is a standard searchable table view and I want as-you-t...

touchesBegan converts to ccTouchesBegan??

I am not sure if the way that applied in touchesBegan can be applied as well in ccTouchesBegan or other touches call back. For example I have some code: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSUInteger numTaps = [[touches anyObject] tapCount]; touchPhaseText.text = @"Phase: Touches began"; touchIn...

Run-loops and threads in Apple's CocoaXMLParser example

In the CocoaXMLParser class of Apple's CocoaXMLParser example, the following code appears: rssConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; [self performSelectorOnMainThread:@selector(downloadStarted) withObject:nil waitUntilDone:NO]; if (rssConnection != nil) { do { [[NSRunLoop currentRun...

Cannot get Twitter-OAuth-iPhone to work

Hi, demo works as expected, no problems. But now I'm trying to integrate it into my project. I use no xib-s, code only: OAuthTwitterDemoViewController *vc = [[OAuthTwitterDemoViewController alloc] init]; [[UIApplication sharedApplication].keyWindow addSubview:vc.view]; [vc release]; it compiles and runs with no errors, but the actual ...

warning:'UIResponder' may not respond to '-manageTouches:'

Hi, this is my program . //Interface file. #import <Foundation/Foundation.h> @interface reportView : UIView { } - (void)touchesBegan: (NSSet *)touches withEvent: (UIEvent *)event; - (void)touchesEnded: (NSSet *)touches withEvent: (UIEvent *)event; - (void)touchesMoved: (NSSet *)touches withEvent: (UIEvent *)event; @end //Implementati...

UITextField: move view when keyboard appears

Hello! I'm currently working on an iPhone application with a single view, which has multiple UITextFields for input. When the keyboard shows, it overlays the bottom textfields. So I added the corresponding textFieldDidBeginEditing: method, to move the view up, which works great: - (void)textFieldDidBeginEditing:(UITextField *)textField...

How to detect edit mode on iphone UITableView

For my iphone app, I have an editable (for delete) table view. I'd like to be able to detect that the user has clicked the "Edit" button. See this image: http://grab.by/It0 From the docs, it looked like if I implemented : - (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath then I coul...

touchesMoved:withEvent.

Hi, I got the coordinates of touchesBegan and touchesEnded. But in touchesMoved can I get all the coordinates of the touch from touchesBegan to touchesEnded. I mean that when I put finger on screen and dragged to some position and then I lifted it. So, can I get all the coordinates of the starting position to end position. If possible, ...

How to resolve this rotation problem?

Hey there For sure this is very trivial math stuff for some of you. But: When I rotate a view, lets say starting at 0 degrees and rotating forward 0.1, 1, 10, 100, 150, 160, 170, 179, 179,999, and keeping on rotating in the same direction, this happens, to say it loud and clear: BANG !!!! BAAAAAAAAANNNNNGGGG!!!! -179,9999, -170, -150,...

NSError domains / custom domains - conventions and best practices

NSError requires a domain, which I understand segments the range of error codes. One would anticipate that there exist somewhere a registry of domain.error code but I've not been able to discover one. Supposedly this could used for looking up localized descriptions for errors. Does anyone have any set of known best practices for deali...

Game platform/engine for inexperienced/solo developer?

There are a number of discussions on stackoverflow.com about what is the best iPhone game platform/engine. My question is not necessarily what is the best, but what is the best for an experienced iPhone developer but not not experienced in game design. This will also be a solo project plus a graphics designer. Consider I will be worki...

How do I release this CGPath when I need to return it

I have a method that returns a CGMutablePathRef, something like this: - (CGMutablePathRef)somePath; { CGMutablePathRef theLine = CGPathCreateMutable(); CGPathMoveToPoint(theLine, NULL, 50, 50); CGPathAddLineToPoint(theLine, NULL, 160, 480); CGPathAddLineToPoint(theLine, NULL, 270, 50); return theLine; } The Xcode/Cla...

How can I improve this piece of code?

Shark tells me that this is a hotspot for bad performance: double distanceA = fabsf(target - current); target is CGFloat current is CGFloat the rest of my calculations rely on double. Maybe there's some smarter way to do this anyways? ...

Is there a faster way to compare two variables?

I have this piece of code where Shark tells me it's a performance bottleneck: CGFloat shortestDistance = (distanceA < distanceB) ? distanceA : distanceB; all these values are CGFloat. Is there a faster way to figure out which one is smaller and assign that to shortestDistance? Maybe even by reference instead of copying a value? How wo...