iphone

Clicking in UISearchBar causes memory leak

I have been getting a weird memory leak and i just pinpointed what is causing. I am using a utility application that has a main view and a flipside view. When you are on the flipside view you are able to present another modal view by clicking a plus button. This view has a UISearchBar and UITableView. When clicking on the UISearchBar...

Ask About NSMutableArray (alloc , arrayWithCapacity)

I have two functions which one should i use? Please explain the difference. A: - (NSMutableArray *)FunctionA:(int)count { NSMutableArray *a = [[NSMutableArray alloc] init]; for (int i = 0; i < count; i++) { [a addObject:[NSNumber numberWithInt:0] ]; } return [a autorelease]; } B: -(NSMutableArray *)FunctionB:(int)...

Alpha + masking + clipping headache

Hi, Here's a graphical explanation of 1) what I have and 2) what I want http://tinyurl.com/yg5zboy My understanding is I need one or maybe two masks to accomplish this. As you can see, I want to combine both alpha channel (for the red semi circle) and a background transparency (to see the background shuttle, even through the hole in t...

Using opengl, how do I combine a background image and a smaller distorted texture?

I am attempting to make an image stretch effect on the iphone. I make a vertex array and shift the texture data for each indice within an arbitrary radius of a background image. Then make the following calls to display: int n = gridSize_.x * gridSize_.y; glEnableClientState( GL_VERTEX_ARRAY); glEnableClientState( GL_TEXTURE_COORD_ARRAY...

Get all days of any month with objective-c

A seemingly simple question...how can I return a list of days for any specified month? NSDate *today = [NSDate date]; //Get a date object for today's date NSCalendar *c = [NSCalendar currentCalendar]; NSRange days = [c rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit forDate:today]; I basically want to use tha...

Is it possible to share code betwee classes that does not have the same parent?

I have two classes that are already subclasses of a different parent (due to an external library I cannot change this). However I want to share some common code between them, say for example, code that handles an action after a popup dialog etc. How do I do this? ...

iPhone settings bundle

I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: When I specify date as the type, my app within the settings app crashes. Working examples would be greatly appreciated. Since this approac...

What's the easiest way to persist data in an iPhone app?

I want to persist a very simple string. For example "abc". What's the easiest way to do this? I don't want to use a SqlLite database. ...

linking mess with libc

I have a library compiled into a .a file, linked against my application. (iphone, developing with Xcode) Everything seems to be fine, linking seems to succeed, but when I run the program it crashes. The point of crash is at a memcmp() call in the statically linked library. The debugger shows all kind of stuff called with "dyld" in their...

Self Deleting iPhone app

I have a iPhone app which needs to have a self destruct option. This app is going to be use on sensitive locations and holds some algorithms which are not to be known by anybody except the iPod Holder. What would be the most "complete" way of deleting the app? I was thinking of some how writing zeros to the nib file. or the actual appl...

AudioSessionInitialize returning inscrutable error code

I'm calling AudioSessionInitialize like so OSStatus result = AudioSessionInitialize(NULL,NULL,interruptionListener,NULL); and getting the result 0xbfffde94 (i.e. -1073750040) which doesn't match anything in the documentation, which are all readable 4CC's like '!ini' and so forth. The good news is that it seems like the call worked. N...

Where is an application's Core Data sqlite database file located?

I would like to write a method that deletes my application's Core Data store, which I would follow by creating a new store. Is there a standard approach for doing this, and where is the database located in my application's sandbox? ...

UIActivityIndicatorView with UITableView in Navigation Controller

Hello guys, I am working on a an application which is very simple a navigation controller with a table view when the user clicks a row, he is directed to the details view. However, the details view pulls data from Core Data. i am pulling a relatively large amount of data that takes about three seconds to load. I wanted to add that UIA...

Updating UI when model is changed

I have a series of UITableViewCell elements with various UIControls to set model values. When I make a change to model, I am having difficulty finding a way to update the UITableViewCell that displays the calculated property from the model. I have placed the model in AppDelegate, and accessing it directly from RootViewController. ...

How to direct my users to my iPhone enabled site?

I have made an iPhone friendly version of my site, that I want to direct my users to. The big question now is how to direct my users to this site. There are a few alternatives: Redirect the user based on the user agent, e.g. if the user agent sent by the browser contains "iPhone" or android or whatever. If the user agent matches the a...

Telling a UITextField to become first responder while embedded in a UITableViewCell

I have a UITextField that is a subview of a UITableViewCell. When my view loads, I want the text field to become first responder. I have a pointer to the text field in the table cell, so to do this I am trying: [myTextField becomeFirstResponder]; This returns NO all the time, regardless of when it's called, which according to the doc...

Stopping a NSTimer

Okay, so, this code is pretty basic. The user inputs an answer into a textbox, if it equals "first + second" they get a point. Then, they have 5 seconds to answer the next math problem. If they do, the function "doCalculation" is run again, and they get another point. IF they don't, then the function "onTimer" is run, and shit hits t...

How do you create UIBarButtonItems with a radio interface?

I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up radio UIBarButtonItems in the class reference definition of the width property: If this property value is positive, the width of the co...

iphone sdk grab php content

Hi I have a php file which when opened browser displays "hello" and nothing more I want to grab this content so it will display "hello" on a label on the iphone Can anyone provide a very simple way of doing this, thanks. ...

NSScanner memory leak

Hello, I'm at my first experiences with iPhone development. I wrote some basic code to test the NSScanner class, and now I was looking into the Leaks tool. It seems that this code is leaking, when in the detailed stack I double-click my last call (before Apple's stuff), the incriminated line is the commented. Can anyone help me to under...