cocoa-touch

How can I get the pinstripe background to show?

I'd like to use the pinstripe background that shows up in the Settings app and many other iPhone apps behind table views. Is is already included in some graphics library? How can I make it show up in a UIView or UITableView? ...

Why does a custom UIButton image does not resize in Interface Builder?

Why does a custom UIButton image does not resize with the button? I set it's view mode to Scale to Fill in Interface Builder, but unlike a UIImageView image, it doesn't respect that setting. Am I looking in the wrong place or is it not possible? ...

UISlider returns two Touch Up Inside events, why does that happen?

I have a slider that I'm using to set a float value somewhere. I connect Value Changed to a method in my viewController. That part works fine. I need to know when the user starts touching the control but not necessarily every single instant that the slider changes (I receive the Value Changed events for that). So I connected a Touch Up...

scrollsToTop not working

I have the following object structure: UITabBarController UINavigationController UITableViewController It used to work, but then I added the UITabBarController into the mix and made a bunch of other large changes and somewhere in between it stopped. So far I have: created a new project with that structure, and that seems to wo...

Is it possible to alter the letter-spacing/kerning of a font with Cocoa Touch?

I've been scouring the Internet for a while now for information on how one can alter the letter-spacing/kerning of a font within UIKit. My fear is, that like using your own custom fonts, you simply can't. Which would be terrible news. I know Apple is protecting us from bad design with these constraints, but they're also preventing us f...

GKSession Problems - Objective-C GameKit

Ok, I've been trying to create my own GKSession object and the delegate method is giving me an error in the console that I haven't figured out how to fix just yet. I was wondering if anyone had any suggestions or had encountered this problem? *Just a note - the variable peerStatus is defined elsewhere in my code. The peer can either be g...

Problem with releasing an object

I've got this code: Entry.h #import <Foundation/Foundation.h> @interface Entry : NSObject { id object; SEL function; } @property (retain) id object; @property (assign) SEL function; -(Entry*) initWithObject:(id)object selector:(SEL)function; @end Entry.m #import "Entry.h" @implementation Entry @synthesize object; @synt...

iPhone - Corrupt JPEG data for image received over HTTP

I'm getting an image over HTTP, using NSURLConnection, as follows - NSMutableData *receivedData; - (void)getImage { self.receivedData = [[NSMutableData alloc] init]; NSURLConnection *theConnection = // create connection } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [receivedData app...

Push View Controller into Navigation Controller

Hi all, Some times when I push ViewController into Navigation Controller, the viewDidLoad() method of the View Controller is not called. And this cause my application to crash. I would appreciate any help. I forget to mention that I load the view from the nib before I push it to the Navigation Controller. Thanks, Sarah ...

Cocoa: Quartz, Core Graphics, Context vs View. Oh My!

Heads starting to hurt. I think I dropped into this too fast... Perhaps someone could help me visualize how these (excluding OpenGL ES) high level drawing libraries fit together - or point me to some high level docs. For example I see "context" and "view" used interchangeably in some cases but a view has one (only one?) context while a c...

Retrieving an iPhone photo saved to the photo library

I am saving images to the photo library and would like to retrieve them dynamically to display in future launches of my app. I use the WriteToSavedPhotosAlbum function, as below, but do not get any info to access the saved photo programmatically. UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector...

MFMailComposeViewController address book picker customization

Is it possible to customise the behavior of how the ABPeoplePickerNavigationController is displayed modally from the MFMailComposeViewController whenever a user presses the '+' icon in the 'To:' and 'Cc/Bcc:' fields? I want to wrap the ABPeoplePickerNavigationController inside of another view controller before it is being presented moda...

Why doesn't initWithNibName work for my UIViewController subclass?

I have subclassed UIViewController into a new class, PageViewController (I'm writing a simple book app). I want to add a new view loaded from a nib file and am using the following code. It works. PageViewController *viewController1 = [[UIViewController alloc] initWithNibName:@"Page1" bundle:nil]; [viewController1.view setUserInteraction...

UILabel place as portrait

I create a label in my iPhone application as: UILabel * lab=[[UILabel alloc]initWithFrame:CGRactMake(100.0,100.0,100.0,10.0)]; lab.text=@"1 2 3 4 5 6 7 8 9 0"; And also added window as subview. Now this label appearing in my view as: 1 2 3 4 5 6 7 8 9 0 I want it as: 1 2 3 4 5 6 7 8 9 0 I mean it will appear as portrait mode. Is ...

Two images intersection transparency

There are two images. image1 and image2. I have added image2 on image1. Overall the output image must be image1 only but, the portion of the image2 must become transparent. I mean the alpha values on the intersection area must be in reverse order( i.e, if alpha value of one pixel( say 120, 100) on image2 is 1.0 then the same pixel's alph...

Optimizing a Cocoa/Objective-C search

I'm performing a search of a large plist file which contains dictionaries, tens of thousands of them, each with 2 key/string pairs. My search algorithms goes through the dictionaries, and when it finds a text match in either of the strings in the dictionary, the contents of the dictionary are inserted. Here is how it works: NSDictionary...

Filter NSFetchedResultsController for nil value?

I have a NSFetchedResultsController which is fetching objects from a NSManagedObjectContext. These objects have a lastOpened property, which is initially nil and is only set when they are viewed. I want my UITableView to display a list of the most recently opened objects, which I can do by adding a NSSortDescriptor to the NSFetchReque...

Photo button like in contacts and Facebook app

How can I create a "person photo" button like the one in contact info or in the Facebook app? (grey and rounded border with a small radius and an image that is cropped inside it) Edit: It must obviously work for all photos, not just one that I prerender in Photoshop. I guess I could do it manually using masks etc., but Facebook app do...

My UIViewController is "lying" about its center property

I'm asking my ViewController for it's view.center property and drawing a new UIView that centers itself around this "center"... I am getting (160, 250) as a response. but when the new UIView draws it's below center... So I'm wondering who's giving me this info and what it relates to? This is clearly where the center of the view is in re...

Reconstituting objects from nib - Just add water? maybe not...

Much I've read talks about the advantages of setting your UI up in IB. And how when the nib is "awoken" all the objects in it "come to life". I'm experimenting with placing about 10 UIView objects into a nib that is owned by a ViewController. The UIView objects are of type MyView and are wired back to their respective properties in the...