iphone

What is -[NSString sizeWithFont:forWidth:lineBreakMode:] good for?

In my question "How do I get -[NSString sizeWithFont:forWidth:lineBreakMode:] to work?", I learned that -[NSString sizeWithFont:constrainedToSize:lineBreakMode:] was actually what I needed. The documentation for -[NSString sizeWithFont:forWidth:lineBreakMode:] states explains it doesn't actually wrap the text to additional lines. So ho...

How to import file into sqlite?

On a Mac, I have a txt file with two columns, one being an autoincrement in an sqlite table: , "mytext1" , "mytext2" , "mytext3" When I try to import this file, I get a datatype mismatch error: .separator "," .import mytextfile.txt mytable How should the txt file be structured so that it uses the autoincrement? Also, how do I ente...

Implementing Delegate Pattern in Objective-C

I am building a class that handles NSURLConnection requests. To allow other classes to use this class, I would like to allow the main class to call a delegate when connectionDidFinishLoading is fired. I've looked through lots of documentation, but I can't find anything that gives any clear examples, and the code that I have doesn't cal...

NSMutableArray memory management

NSMutableArray *a1 = [[NSMutableArray alloc] init]; NSMutableArray *a2 = [NSMutableArray array]; TempObj *obj = [[TempObj alloc] init]; //assume this line is repeated for each obj [a1 addObject:obj]; [a1 addObject:obj2]; [a1 addObject:obj3]; [a1 addObject:obj4]; [obj release]; [obj2 release]; [obj3 release]; [obj4 release]; [a1 releas...

export key in x509 for iphone

Hey, all - I'm having issues with the iphone sdk. I created a key pair and can encrypt and decrypt with it with no problems. Now I need to get the public key in X.509 format to pass to a Java-based web service. SecKeychainItemExport is available in the standard Cocoa libraries, but this function apparently isn't available through the ...

iPhone app - Show UIActivityIndicator while an IBAction is performed

Hi I want a button in my navbar which lets the user refresh the contents of a tableview. The tableview is already populated and once the user presses the refresh button, I want to show a UIActivityIndicator while I fetch the items to be displayed on the table. I tried putting a [indicator startAnimating] before calling the method to ge...

working makefile compiling OpenGLES through SSH on iphone (not on desktop)

Can someone show me how I have to setup my bigboss toolchain installed on iphone to support openglES & what i need to put in the makefile? ...

iPhone Development - Memory limitation for iphone application

Can anyone point into the right direction here. I want to respond when my application receives memory warning, (i want to know how to respond to this notification). Plus, How much memory can i wire with my application? Any articles or book reference would be great. Thanks. ...

How can I programmatically determine if my app is running in the iphone simulator?

As the question states, I would mainly like to know whether or not my code is running in the simulator, but would also be interested in knowing the specific iphone version that is running or being simulated. EDIT: I added the word 'programmatically' to the question name. The point of my question is to be able to dynamically include / ex...

How can my iphone app detect it's own version number?

I'm writing an iPhone app. It's already been published, but I would like to add a feature where it's version number is displayed. I'd rather not have to do this manually with each version I release.. Is there a way in objective C to find out what the version is of my app? ...

Quartz 2D/OpenGLES geometric distortions on images (preferrably using CGImage)

What is the preferred method for implementing such geometric distortions as pinch/fisheye/etc. using the iPhone SDK? I know that the Core Image library for OSX has all these types of filters built in, but not for the iPhone SDK. I can create a displacement map at a specific location and radius given the original source bitmap data, but...

Long-term potential of iPhone/Windows Mobile development platforms

It seems that Apple has so far gone the furthest of any mobile platform in creating a good all-around developer ecosystem (SDK, app distribution, monetization, etc). However, reading the comments from previous SO questions on mobile development (e.g. this and this), certain criticisms seem to pop up, such as the following: Objective-C,...

What's the easiest way to get the current location of an iPhone?

I already know how to use the CLLocationManager, so I could do it the hard way, with delegates and all that. But I'd like to have a convenience method that just gets the current location, once, and blocks until it gets the result. ...

iPhone Security Guidelines

Silly question: Does Apple provide specific guidelines for contacting servers via http vs https? Also, what data is considered to require https (ie password, geopoint, bank data, etc.) Is there a concrete guideline from Apple on this? More specifically, does anyone know exactly how Apple checks/verifies that an application should or shou...

iPhone Programming: Send a text message? Access contact list?

I'm still new to the API and I wanted to ask: Can you send a text message programmatically? Can you access the users contact list programmatically? I'm thinking no. I haven't seen anything about text messaging in the API, and I figure the sandboxing that the iPhone does keeps you away from the phones contact list. Thanks everyone. ...

Which open source licenses are compatible with the iPhone and App Store?

I'm writing an iPhone app, and I would like to use a 3rd party library for part of its functionality. I intend on selling it through the App Store and my code will not be open sourced. Which open source licenses allow this? ...

Cocoa Touch behavior for events

I have been over the iPhone Programming Guide several times regarding the behavior of when the event methods are called in an app. From what the guide says: touchesBegan is called when a finger first touches the screen. touchesMoved is called when a finger on the screen moves. touchesEnded is called when a finger lifts off the screen....

How exactly does applicationWillTerminate work on iPhone?

I'm considering how to make my iPhone application as "bullet proof" as possible. Right now, I'm thinking about how the app will respond to the user hitting the home button at a critical point in the application's processing. What exactly happens? Are any more instructions executed in the application's threads? When applicationWillTer...

iPhone Development - Pool for results

Basically i want to be able to call a single method that can pool for location and when found, return the CLLocation object. I want to know how can i pool for results? ...

TableView won't send setEditing message to cells

Hi, So far I have a UITableView, it works properly and all. My problem is when going into "editing" mode, apparently the cells are not changing at all, and the red sign (delete control) only shows up when I drag the cell out of the tableview (meaning the iphone reloads the cell again, and it is here when it detects that the cell was "f...