cocoa-touch

Is there any system level background queue process in iPhone?

I need to save a big file, sometime it takes a very long time to finish, user might just close the application. I am wondering whether the iPhone SDK could take over the unfinished big task. Appears iPhone's own mail system could do background send. I prepared a email, click send, then close the mail app immediately. In home page, aft...

Custom Drawing with Xib file present

I have a view that I want to add some custom drawing to. I know how to do this with a View that isn't connected to a Nib/Xib file - you write the drawing code in the -drawRect: method. But if I init the view using [[MyView alloc] initWithNibName:@"MyView" bundle:[NSBundle mainBundle]]; -drawRect: of course doesn't get called. I trie...

iPhone App Status Bar

Just getting started with my first iPhone app. My app will be full screen, but I am having trouble finding the document that explains how to change the status bar properties. Anyone have any pointers? ...

How do I attatch a Key value pair to a UIView on iPhone?

Hiya, When I started iPhone development, I read somewhere that it's possible to attach a key value pair to a UIView. I understood that all UIViews could be used as dictionaries to store any data you may want to attatch to them to prevent unnecessary subclassing. However, I've searched everywhere to find the reference and tried to implem...

How can I lower the volume of iPod audio while my app plays a sound

I'm trying to reproduce the functionality of built-in Mail application when a new message arrives while you are listening to iPod music. What happens with the Mail app is: iPod's volume lowers a bit Mail app plays a short sound and vibration iPod's volume goes back to normal I know how to play a sound and cause vibration, what I don...

How to customize the background/border colors of a grouped table view?

I would like to customize both the background and the border color of a grouped-style UITableView. I was able to customize the background color by using the following: tableView.contentView.backgroundColor = [UIColor greenColor]; But the border color is still something I don't know how to change. How do I customize these two aspects...

layer hit test only returning layer when bottom half of layer is touched

I have a sublayer on a layer-backed view. The sublayer's contents are set to an Image Ref and is a 25x25 rect. I perform a hit test on the super layer when the touchesBegan and touchesMoved methods are invoked. The hit test method does, in fact, return the sublayer if it is touched, BUT only if the bottom half of the image is touched. ...

Releasing Objects when using a UINavigationController

I'm using a UINavigationController and I'm having trouble releasing objects when I push a new view. I want to set an object on the new controller before pushing it. The way I'm currently doing this is: OpenPageViewController *varOpenPageController = [[OpenPageViewController alloc] initWithNibName:@"OpenPageViewController" bundle:nil]; v...

How to parse a binary file with floats (Java generated) using Cocoa Touch?

Given the following Java code for generating a binary file: DataOutputStream out = new DataOutputStream(new FileOutputStream("foo.dat")); out.writeInt(1234); out.writeShort(30000); out.writeFloat(256.384f); I'm using the following Objective-C code and manage to parse the int and the short values: NSString *path = [[NSBundle mainBundl...

Getting Justified Text in UITextField

How do I get justified text with UTTextField. It does have an textAlignment property. But the UITextAlignment constant only has left, right, and center justification. What I am seeking is the Justified text common in word processing app with text flush with both left and right edges. This is a read only text field. I have seen it in f...

Adding First and Last buttons in Navigation Bar

This is what i'm trying to achieve: Home (Table View) > (Click on row) > Move to 2nd View (Table View) > (Click on row) > Move to 3rd View (Table View) - SAVE or DONE button in navigation bar should take the user to Home (Table View). A sample code will be very helpful. Thanks Mustafa ...

Possible to generate an iPhone application automatically from another iPhone application?

As title; is there any function that can achieve this? ...

What is the simplest way to parse binary files in Cocoa Touch?

Say I have a binary file (generated with Java) containing a 32 bit int value. I'm currently using the following Objective-C code for parsing it: NSString *path = [[NSBundle mainBundle] pathForResource:@"foo" ofType:@"dat"]; NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path]; unsigned long intValue; memcpy(&intValue, [[...

Adjusting interface when keyboard appears for UITextField or UITextView

Hi all, I have a table with each cell containing a label and a text field. Problem is that when i go to edit the last row, keyboard hides the lower portion of the table, and i can't see what is being typed. How can i move my interface above the keyboard so i see what is being typed? Thanks, Mustafa ...

NSURLConnection downloading poor quality JPEGs on 3G

Hiya, I am downloading a JPEG image from a server and assigning it to an image object in my iPhone app using an NSURLConnection. All works fine when I'm on a Wifi connection, but as soon as I switch to 3G, the quality of the JPEG downloaded reduces dramatically. Has anyone else experienced this? Does anyone know of a way to force the...

Objective C NSString* property retain count oddity

I have the following example class: Test.h: @interface Test : UIButton { NSString *value; } - (id)initWithValue:(NSString *)newValue; @property(copy) NSString *value; Test.m: @implementation Test @synthesize value; - (id)initWithValue:(NSString *)newValue { [super init]; NSLog(@"before nil value has retain count of %d...

What is a good vector library for Cocoa or Cocoa-touch?

I'm looking for a good vector library for displaying animated graphics on the iPhone. Something that could possibly display SVG. Anyone have any ideas or insights? ...

How can I customize the accessory disclosure image in a UITableViewCell?

I would like to use a custom version of the standard disclosure accessory image in my UITableView. How can I do this? I'm hoping that sub-classing UITableViewCell is not necessary for something this basic. ...

How to customize the background color of the standard label within a UITableViewCell?

I'm trying for the past several hours to figure out how to do this, but with no luck. There are several potential solutions for this when searching Google, but nothing seems to work. I'm trying to customize the background color of the standard UILabel that goes in a UITableViewCell (since I already customized the background color of the...

How to create equivalent of Java's CardLayout or ASP:MultiView with UIView and subViews?

Ideally I'd like to be able to create the views in Interface Builder and then swap them with code. Any pointers to sample code or tutorials would be appreciated. ...