iphone

Using depth buffer on iOS with OpenGL ES 1.1.

Hello, I'm trying to get a depth buffer working so I can start making a game for iOS. I'm fine with OpenGL and Objective-C for OSX but this is my first time making an iphone application. I removed the ES1Renderer and ES2Renderer classes and moved the ES1 code into the EAGLView class. The default animation worked when I did that. When I ...

UITabBarController with portrait / landscape views

I have a subclass of UITabBarController which i am using so that i can rotate to use my app in landscape too. How would i go about rotating my UI and getting each view controller to use a landscape view xib? I have always just written apps before where returning YES for shouldAutorotate... handles it automatically for me... this isn't ...

Loading a UIPicker to a predetermined spot

If I have a basic array such as: NSArray *array = [[NSArray alloc]initWithObjects:@"Object1",@"Object2",@"Object3",nil]; self.pickerData = array; [array release]; The picker will be on "Object1" when the view is loaded. How can I have the picker start off settled on "Object2"? ...

Multithreading problem(UI not updated)

Hey, I have a problem in Multithreading. To describe this, I have two threads. On main thread I have some logic And on another thread, I have a logic and some logic to UI which will update UI. What I want to do is that I want to call some method after the UI on another thread is updated. I think I am supposed to use NSOperationQueue or s...

Is it better to supply new artwork or scale down large images to deal with the Retina display?

The amazing display on the iPhone 4 has made us make higher resolution artwork to take advantage of the new screen. My question is, what is the better way to apply the images? Currently, there are two methods to do so: Using two images: "image.png" and "[email protected]". The problem with this is that, if your app needs a lot of images, t...

Weird iPhone error

NSUserDefaults *profiles = [NSUserDefaults standardUserDefaults]; if([[profiles stringForKey:@"approvalline1"] isEqualToString:@"Approval"] == YES) { [picker selectRow:1 inComponent:0 animated:NO]; } if([[profiles stringForKey:@"approvalline1"] isEqaulToString:@"Disapproval"] == YES) { [picker selectRow:2 inComponent:0 animate...

Adding a simple UIView from a class to the main ViewController

Dear scholars, code gurus. My question is rather simple, I have been searching and trying for some time now without any luck, I would greatly appreciate some tiny help. I have a simple class that should generate a view as following: // vipcardclass.h // #import <UIKit/UIKit.h> @interface vipcardclass : UIViewController { } +(IBA...

Debugging a 3.1.2. device from xcode 3.2.3

A versioning issue here. We have an application built with xcode 3.2.3 with the iOS 4.0 SDK, but with deployment target set to 3.0 so it will still run on older iPhones. The program is crashing, so we want to debug. Getting the standard "The Info.plist for application at /Users/robbonner/Desktop/Eventful.0.8.1 2/build/Debug-iphoneos/E...

Android's viewDidLoad and viewDidAppear equivalent

Does Android have an equivalent to Cocoa's viewDidLoad and viewDidAppear functions? If not, then how would I go about performing an action when a View appears? My app is a tabbed application, in which one of the tabs is a list of forum topics. I would like the topic list to be refreshed every time the view appears. Is such a thing poss...

NSThread problem on iPhone

I'm using two threads in an iPhone app for the first time and I've run into a problem. In this prototype, I have a view controller that loads a local web page. I want an activity indicator to show until the page has finished loading. With the code below, the activity indicator starts, the page loads properly, but the activity indicator d...

Navigating .Xib files in an IBAction

I have an app with several views and controllers. They all work together fine in a TabBar. One of the views has a UIPickerView in it with a ToolBar above it with three tabbar items connected to IBActions, again working fine. I now want to use one of the tabbar items to change view instead of what I originally wanted it for. Trouble is I ...

Is it possible to put audio into 'phone' mode?

By this I mean, use the speaker and phone microphone but don't use the speaker in the handsfree style. So the use case is: 1. User is listening to the app via the phones speaker 2. They wish to put the phone to their ear so they choose an option which changes the audio to be as if they were talking on the phone (i.e. non-hands free mode...

How to change a recorded voice to a man's voice in Core Audio (Audio Unit/ Remote IO) for iPhone

Hi All, I am new to Core Audio and really lost, I am trying to record an audio and then apply voice modulation to that recording and play it back. I have looked at the example Speak Here which uses Audio Queue for audio recording. I am stuck at the part of how to change the audio samples. I understand that it can be done using Audio Unit...

AVCaptureSession commitConfiguration stuck

Hi all, I'm working on an iPhone app that requires both live capture frames and the ability to take full resolution photos. This requires switching from AVCaptureVideoDataOutput to AVCaptureStillImageOutput and back. I do this by having 2 outputs, and changing the preset according to the needed state. This is the code that is called a...

iphone UITextView exception

Hi, The following code goes to exception for 3.1.3: [textView select:self] unrecognized selector sent to instance etc.. But the same code is working for 3.2. I don't understand the error since this function is available starting from IPHONE_3_0 !!! Thanks for help ...

NSBundle and Accessing Folder inside Resources Folder

I have Images folder inside the Resources folder which contains images. I am using the following code to access the images but the resultant array always comes out to be empty: NSArray *imagesPath = [bundle pathsForResourcesOfType:@"gif" inDirectory:@"Images"]; Am I missing something?? ...

Converting beginTouches and endTouches to ccBeginTouch and ccEndTouch

I'm converting the game I'm working on from UIkit to coocos2d. Using UIKIT I would use the code below code to pass the touch evens to a method. What would be the equivalent in Cocos2d? - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // Save the position for (UITouch *touch in touches) { // Send to th...

UITableView position

hi, my app uses a tab bar with 2 navigation based views in which I am adding a custom view (a title bar) between the nav bar and the table view . - (void)viewDidLoad { [super viewDidLoad]; // load title bar controller TitleBarViewController *tbar = [[TitleBarViewController alloc] init]; [tbar setTitleImage:[UIImage imageNamed:@...

display DetailsViewController using NSFetchedResultController

Hi everyone, In my iphone app I have core data to-many relation topic -->> question, so every topic contains a few questions, I figured out how to display list of topics in UItableView using NSFetchedResultController, but I can't get how shall I construct my FetchedResultController to display questions in chosen topic. I'm trying to fi...

How to tint a transparent PNG image in iPhone?

I know it's possible to tint a rectangular image by drawing a CGContextFillRect over it and setting the blend mode. However, I can't figure out how to do a tint on a transparent image such as an icon. It must be possible since the SDK does it itself on tab-bars in such. Would anyone be able to provide a snippet? ...