iphone

FFMPEG libx264 2-pass for smartphones

I use the following ffmpeg command to convert a video for smartphones. It works for Droid x and Iphone4, but not windows media player nor the older version of droid. Can anyone shred some light? Those droids works with Youtube h264 codec. But somehow doesn't play the video of my encoded mp4 (the audio plays just fine). ffmpeg -y -i ...

How to use MPMusicPlayerController with AVAudioPlayer

Hi All, I am trying to play an in app audio with ipod the code I am using to play the audio file is: Code: [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil]; UInt32 doSetProperty = 1; AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(doSetP...

iOS Memory Management: ivars, static, and NSStrings

Hi there, I have managed to get myself confused about some elements of memory management. I am new to objective-c, and memory managed languages generally. I have read the memory management guidelines, but I remain confused about a couple of things. 1) Is there any need to clean up ivars, and method variables that are not retained b...

Why do some of my core data objects have managedObjectContext set to nil?

I was having problems adding objects to one of my core data objects that has a relationship and after doing some investigating I realized it was because that objects managedObjectContext was nil (0x0). Some more investigating revealed that anytime I created an object of that type, the managedObjectContext was always nil. Every object I c...

How can I print "\n" using NSLog?

How can I print "\n" to the console by using NSLog or printf function? Basically I was trying to print a String with value "Hello\nWorld". My requirement is, I want to print it AS IT IS. But when I tried to print, it was printing like, Hello World not as Hello\nWorld ...

iPhone UISearchBar view not updating immediately?

I currently have a UISearchBar and UIDisplayController defined in my RootViewController as: - (void)viewDidLoad { [super viewDidLoad]; //Add the search bar aSearchBar = [[UISearchBar alloc] initWithFrame:CGRectZero]; [aSearchBar sizeToFit]; aSearchBar.delegate = self; aSearchBar.placeholder = @"Search YouTube......

Draw calls take WAY longer when targeting an offscreen renderbuffer (iPhone GL ES)

I'm using OpenGL ES 1.1 to render a large view in an iPhone app. I have a "screenshot"/"save" function, which basically creates a new GL context offscreen, and then takes exactly the same geometry and renders it to the offscreen context. This produces the expected result. Yet for reasons I don't understand, the amount of time (measured ...

Hidden element causing scrollbar to appear when window goes below a certain width

I am having the weirdest problem. I'm trying to make a page that fits a resolution of: width: 640; height: 960; for the iphone. But there is a hidden element that I can't access with the Developer toolbar or Firebug that is adding an extra 100pixels to the right of my page. I've set the correct height and width for the html, body, an...

How would I create back, forward, and refresh buttons for a UIWebView programmatically?

I currently have a webview created but I do not want to use interface builder to create the back, forward, and refresh buttons. How would I create these buttons programmatically? I know how to create regular buttons with code, but as for webView delegate buttons, I am lost and have not been able to find many resources on it. ...

Does UITableView's indexPathsForVisibleRows return the wrong paths?

Hi there, I use the following code to trigger image downloads in visible cells/paths: - (void)loadImagesForOnScreenrows { NSArray *visiblePaths = [tableView indexPathsForVisibleRows]; for (NSIndexPath *indexPath in visiblePaths) { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if([cell viewWithT...

Objective-C arrays and class variables

I am porting an Android app I made to iPhone and running into problems with the syntax (I think) I'm basing the project off of the example from http://iphonedevelopment.blogspot.com/2009/04/opengl-es-from-ground-up-part-2-look-at.html I would like to pull out the geometry from the rendering process to keep the code modular but I can'...

error: expected specifier-qualifier-list before 'SearchViewController'

i have a search view controller like below. @interface SearchViewController : { TopicRulesViewController *TViewController; } i want to move to another view.but i am getting this "error: expected specifier-qualifier-list before 'TopicRulesViewController'" what is that error? thanks in advance ...

Handling applicationDidBecomeActive

I have the UIApplicationDelegate protocol in my main AppDelegate.m class, with the applicationDidBecomeActive method defined. I want to call a method when the application returns from the background, but the method is in another view controller. How can I check which view controller is currently showing in the applicationDidBecomeActiv...

Objectiveresource redirect to the current user on a UIView

I'm trying to use ObjectiveResource to make an iPhone app speaking to my Ruby site. I can connect with log/pass, but I would like to have directly the account page on the first screen. I retrieve the name like this : self.title = [ObjectiveResourceConfig getRemoteUser]; But unable to have all informations (always a nill object) when I t...

Strange Behavior with touches near a UINavigationBar

I've recently come across a weird bug with UINavigationBars. For some reason, the UINavigationBar "absorbs" any touches that land around 8 pixels below the bar. A good description of this behavior can be seen here: http://dinhviethoa.wordpress.com/2009/02/14/uinavigationbar-and-touch-events-strange-behavior/ None of the touches will r...

Framework for iPhone / iOS asynchronous multiplayer gaming?

I'm curious if anyone knows of any frameworks that enable asynchronous multiplayer gaming in iOS? I know GameKit/Game Center eases synchronous (realtime) multiplayer gaming - I'm thinking of something more like Words With Friends. There would obviously need to be a server-side element that I'd have to provide, to store game state and s...

[cocos2d-iphone] Infinite maps/scrolling question

I'm using cocos2d for the iPhone to create an infinitely scrolling horizontal tile map. To achieve this, I've generated a library of 'segments', which are basically horizontal chunks of levels that I randomly choose from and append to the end of that particular levels tile map. When tiles scroll off of the left of the screen they are rem...

Networking with ios

Hi, I have an application that was written in Java and runs on the users machine. I now want to build an application on the iPhone which will communicate with my java app. Can somebody point me in the right direction on how I can send and receive TCP packets with the iPhone, I want to of course be able to do that using wifi and 3G. Th...

iphone app checking internet access

Possible Duplicate: How to Check for an active Internet Connection on iPhone SDK? How can I make my app check for internet access. If it's not available it should present a dialog box telling the user and show the select a network view. ...

Objective C (iphone/ipad) - carousel coding best practice

I need to build a scroll view (with 10 items for example) that can be continuously scrolled (with paging enabled). In other words as you keep scrolling to the right, you see the item you started with once to get to the end, and it just keeps looping. I'm looking for recommendations on how to a approach this. I will be receiving an array...