iphone

Memory management when using UIImage

Hi My application heavily uses the UIImage object to change images on a single UIImageView based on user input and the previous image which was set. I use [UIImage imageNamed:] to create my UIImage objects. I guess this is not the best way to use UIImage coz my memory usage keeps increasing with time and never drops. (Got to know this ...

Performance and background images for OpenGL ES/iPhone

I'm developing a 2D game for the iPhone using OpenGL ES and I'd like to use a 320x480 bitmapped image as a persistent background. My first thought was to create a 320x480 quad and then map a texture onto it that represents the background. So... I created a 512x512 texture with a 320x480 image on it. Then I mapped that to the 320x480 qu...

Gradients on UIView and UILabels On iPhone

My application needs to display text in either a View or Label but the back ground must be a gradient as opposed to a true color. Using a graphics program to create desired look is no good as the text may vary depending on data returned from a server. Does anyone know the quickest way to tackle this? Your thoughts are greatly appreciate...

Iphone SDK - Can I start a file (song) in the ipod feature of the iphone via the SDK?

I would like to have a feature in my iphone application that would start playing a file in my ipod section of the iphone. Does the SDK allow calls to this? Is there a simple way to start a song from my application other than using the iphones native interface? ...

iPhone SDK:Saving a streamed audio file to Documents folder

Hi I want to save an audio file to the Documents folder of my application while one of the classes in my app is streaming it. How can I do this? Is it possible to save the streamed audio directly to an mp3? (if the audio file being streamed is an mp3 or I have to use caf?) Thanks. Edit: What if I am running the save in another threa...

How to log SQLite queries on iPhone

Hi, I'm doing an iPhone application, and I'm using SQLite. The problem is that I had some issues with the query (I did bad binding) so, this is my question: How can I log in my iPhone application the effective SQL query/statement with the bindings that SQLite receives? Thanks. ...

On which kind of memory a C struct is allocated when initialized as a class variable in Objective-C

Consider the following: typedef struct { float m00, m01, m02, m03; float m10, m11, m12, m13; float m20, m21, m22, m23; float m30, m31, m32, m33; } Matrix; @interface TestClass : NSObject { Matrix matrix; } - (TestClass *) init; @end @implementation TestClass - (TestClass *) init { self = [super init]; matrix = (Matri...

iPhone App name rejection?

Has anyone had apple send back the app with a name change requirement? We submitted our app in Nov. and have been going back and forth with them, we corrected the items they asked us to fix which were both interface and memory driven, and they said nothing about the name. They have been testing our API a TON so we know they are doing som...

HowTo for newbie: Managing currency in iPhone app

I'm building a app that need manage money datatype. I'm new on Obj-c, so I can't see the ligth in the use of NSDecimalNumber. For example, in my unit test I do this: @interface SamplePerson : NSObject { NSString *name; NSDate *birthDate; NSInteger size; NSNumber *phone; NSDecimal balance; BOOL *isOk; } @proper...

How to create a GUID/UUID using the iPhone SDK

I want to be able to create a GUID/UUID on the iPhone but I can't see any way to do it. The intention is to be able to create keys for distributed data, that are all unique. Do I need some third-party code or is there a built in way to do this in the SDK? I have tried Googling it, but I could find anything. ...

How can I replicate the trashing animation of Mail.app

In my iPhone app, I have put a UIBarBUtton of type UIBarButtonSystemItemTrash in my UIToolBar. When pressed, I'd like to replicate the animation of Mail.app: the bin opens, the UIView folds and flies into it. Is there a way to access this animation ithrough the iPhone SDK? Presently I am using a custom made animation, but there are so...

How do I make an iPhone web app mimic a non-web app?

I've been considering making a quick little iPhone web app. I started reading about and experimenting with the special meta tags and attributes documented at Apple's Web Apps Dev Center: viewport apple-mobile-web-app-capable apple-mobile-web-app-status-bar-style -webkit-border-radius -webkit-border-image autocorrect autocapitalize app...

What software and hardware are essential for developing for iPod? On a PC?

I have an idea for a simple application to run on an iPod. I'm an experienced programmer but have no experience on iPod or any Mac or Apple operating system. What are the bare essentials in terms of hardware and software to begin developing using a PC as the development platform? Does the PC need to be running Linux? ...

Is there a way to capture the ouput of NSLog on an iPhone when not connected to a debugger?

I'm logging a bunch of data with NSLog(). Is there a way to capture the log data when my iPhone is not connected to my development machine and running under a debugger? For example, can I redirect it to a file and then read the log file back through Xcode at a later point in time? I need to do this in order to test my app when the W...

iPhone Memory Debugging

I'm using Instruments to try to determine if there are places in my application that I could be more efficient with use of memory. I've taken the time to get somewhat familiar with Instruments but I'm generally a newbie with hunting memory management issues having come from a Java background. I seem to be using about 1.82mb by calls to t...

Autorelease iPhone

Coming up towards the end of developing an iPhone application and I'm wondering just how bad is it to use autorelease when developing for the iphone. I'm faced with some fairly random crashes and, so far, I can't pinpoint it to anything other than sloppy memory usage. As a Cocoa newbie I remember initially reading a guideline document ...

Setting the editing style on a UITableViewCell

I'm trying to set the editing style property of a UITableViewCell in a Cocoa Touch (iPhone) app. For an example of what this looks like, check out the Contacts app, where you can see the little green plus sign to the left of some of the cells. The UITableViewCell inspector in Interface Builder has an editing style drop down, but it d...

Cocoa Touch: What to release, when to release it?

I'm trying hard to understand when and what I must relase in Cocoa Touch as it doesn't have garbage collection. This code block is from apples iphone sample PeriodicElements and they release anElement and rawElementArray but not thePath, firstLetter, existingArray and tempArray? I would have thought that at least tempArray and existing...

iphone: Sending multitouch from the device to the simulator?

I need to record a video of a multitouch game I'm working on, and I'd like to record it from the simulator. My idea was to send touches from the device to the simulator (like this project does with the accelerometer). Just by googling I haven't found anything like that, but before I start implementing it I thought I'd ask here if anyone ...

How can you access a set of photos with the iPhone SDK?

I know that I can access the camera or show the image picker to the user, but what if I just wanted to pick 10 photos, randomly, from the images stored on the device with no user interaction? Using UIImagePickerController gives me the ability to use the camera or the image picker, but how can I do this automatically, without user inter...