iphone

Center content of UIScrollView when smaller

I have an UIImageView inside a UIScrollView which I use for zooming and scrolling. If the image/content of the scroll view if bigger than the scroll view everything works fine. However, when the image becomes smaller than the scroll view, it sticks to the top left corner of the scroll view. I would like to keep it centered, like the Phot...

iPhone: programatically press a button

Hi, Is it possible to press a button in iPhone SDK programatically without the user touching it? Thanks. ...

Memory initialized in initWithCoder is lost in drawView

Hi, I have some memory which is initialized in initWithCoder:. I can verify that before the "return self" part of initWithCoder the memory is initialized. I allocate the memory using malloc and fill it using a custom function: // in initWithCoder: fontTexCoords = (GLfloat *)malloc(10 * 8 * sizeof(GLfloat)); [fontInfo textureCoordinate...

iPhone to PC Remote Control

I'm new to writing networking software and am looking for a high-level point in a direction. I've been playing with writing code for both Java and the iPhone (independently, of course) for a few months now and would like to write an iPhone app that can communicate with a target PC. My "end-game" is to create an iPhone remote control fo...

Opening UINavigationController UITable from a simple UIView

Hey all, This problem has been driving me nuts all day and there has to be a simple answer. I need to create a login page that then provides access to a UITableView which will then be controlled by a UINavigationController. The question is how do I get and initially loaded login page (UIViewController - as created by the "View-base...

My last of the memory leaks

I THINK this line is causing a 3.5K Byte memory leak, any ideas why? If it's not this line it could be how I have the webView setup in xib?? I have an outlet to the webView that I use in the line below. I get general Block 3584, 1024, and 512 leaks _CFURLCache and a NSCFArray leaks. Along with some help on this, can anyone tell me if...

Does a CAKeyframeAnimation pick up the current state when a new CAKeyframeAnimation starts while another is running?

I wonder what would happen. i.e. I kick off a CAKeyframeAnimation, and while it runs I kick off another one on the same keyPath and object. I want it to pick up the current state, but unlike in the nice UIView CA wrapper methods, I don't see a "beginsFromCurrentState" property. So would it pick it up or not? ...

Error setting property on CLLocation subclass

I've defined this subclass of CLLocation MyLocation.h @interface MyLocation: CLLocation { NSString *datum; NSString *ellipsoid; } @property(nonatomic,retain) NSString *ellipsoid; @property(nonatomic,retain) NSString *datum; MyLocation.m @synthesize datum,ellipsoid; Now i get a CLLocation instance through the location mana...

When you are using Xcode to make an iPhone app, how do you change the app's icon?

When you are using Xcode to make an iPhone app, how do you change the app's icon? Right now my icon for my app is just plain white. ...

When you are making an iPhone app using Xcode, how to you get a keyboard to work?

I have a editable text box and when I click on it I get a keyboard. But, it won't let me close out of the keyboard. When I go into the properties of the editable text object ( the Text View object ) and make the return button "Done" it still won't let me exit out. ...

Objective-C class instance zeroed at alloc?

Is there any kind of memory-zeroing objective-c undertakes on my behalf when I first allocate a class instance? I see a lot of objective-c code out there that presumes their outlets are nil by default. If I do the same am I basing such behavior on false pretenses? ...

2D Arrays in Objective C

I have a collection of NSObjects that I want to store in a 2D array generated at run time. In C# I'd just be using some of their friendly generic containers, but not too sure the best way to go about it in objective-c for iphone development. I'm guessing that NSMutableArray isn't the best route. I don't need the array to grow, I'll kno...

Memory Management Question in Objective C

I have a tableviewcontroller where I populate some data from a sqlite db and for each row, I download a file from a http server and cache it locally. I cache it only when the "detailsview" is opened. And the detailsview responds back to this table through a delegate after the file download is complete. But, when this tableview itself is...

How do I compile for the device without a certificate?

I may just be looking in all the wrong places, but is there no way to compile a Cocoa Touch application for ARM without paying for a developer account and certificate? EDIT: To clarify: I am trying to build for a jailbroken device. I simply want to test code on-device without paying for anything. ...

UITableView frame height animation glitch

If I attempt to animate the frame height of a tableView (ex: height -= 200), the cells that appear in the last 200px disappear suddenly before the smooth animation of the frame completes. To make sure that it's nothing else I'm doing, I created a new View-Based application. In the main viewController I create my own tableview with enoug...

Lazy loading makes iPhone app less responsive first time around, can I prefetch images?

Due to the lazy loading nature of view controllers in iPhone, my app is a bit slow in response the first time when you go to the various screens, which has a rich graphics elements (custom graphics assets) in it. Will preloading the app images ahead of time, that is, by calling [UIImage imageNamed: ...] ahead of time so the next time it...

Insert string at cursor position of UITextField

Hello, I've got a few UITextFields in an UITableView. The user should be able to insert only numbers and dots. To do this, I set the keyboard type to UIKeyboardTypeNumberPad and added a '.'-Button at the bottom left corner. Every time the button is pressed, a function is called. This function should insert a dot at the current cursor pos...

iPhone: Get camera preview

Hi, I'd like to get the image that is being displayed on the UIImagePickerController when user uses the camera. And when I get I want to process the image and display instead of regular camera view. But the problem is when I want to get the camera view, the image is just a black rectangle. Here's my code: UIView *cameraView = [[[[[[...

How do I resize the UITableView's height dynamically?

In my app, I would like to resize the tableview's height when it's in edit mode vs when it's not (in order to make room for editing controls below the table view) How should this be done? ...

What's the point of kCAAnimationDiscrete and kCAAnimationPaced?

The documentation is very poor on this. What's the effect of these? The only thing that seems to work as expected is kCAAnimationLinear. What can I do with the others, for example? ...