cocoa-touch

Paging UIScrollView with peeking neighbor pages

Look at the App Store app, on either the iPhone or the iPad, specifically the piece on the screen of app details that shows screenshots. The screenshot viewer shows you the screenshot you're looking at, and the edges of the next and previous one. I need to implement something much like that. How I've done it is fair to poor: I built a U...

iOS Mail Message View like UIWebView

The Mail Message View is as I see it a scroll view with a container, the container again has a header (including the from, date, and subject field) and the content webview. Now when you zoom in the webview, the header stays at the same place and size. Is it possible to do a view like this with the public APIs? I see as problem that th...

UIButton target size

The Human Interface Guidelines says "Create controls that are at least 29 pixels high and provide a target area that’s 44 pixels high". So I was wondering when I use an UIButtonTypeCustom with stretchable Background Image and Text, is there a way to set the target area? Just changing the buttons frame to 44 pixel stretches the backgrou...

After dismissModalViewControllerAnimated the parent view is set to fullscreen

Hi. After every dismiss off a ModalViewController the parent view is set to fullscreen. Why? Before After +----------------+ +------------------+ |head | | detailview | +----------------+ | | |detailview | | | | | | | | ...

iPhone4 UI Element Size in Pixels?

Does anyone know where the various screen dimensions are for the iPhone4? I have checked the MobileHIG but alls I could find where references back to the old iPhone3G. Should I just assume that all previous values are doubled (i.e. StatusBar = 40 pixels), or is there a more accurate illustration (like the one below hidden somewhere else?...

Ping webserver when iphone app loads

I was wondering how I could ping a web server of mine when my application first starts. I am assuming I would do s via the appdelegate in the application? Is there any specific example I could use? ...

Getting Objective-C to talk to JavaScript with UIWebView

I am building an iPad app that loads local html files in a UIWebView. I have an int stored in a view controller that I want to use to determine what content to load into the html document. Additionally, I want to have clickable links in the html that create generate new, smaller UIWebViews on the highest layer, like a "pop-up". How doe...

Stored Block Closure as IBAction

I am trying to reduce ceremony and out of academic curiosity I want to know how to do the following without the IBAction method defined in the .m file to use a closure whenever an Interface Builder wired action occurs such as a button press. You could say that I want to imply the cancelButtonPress method below instead of having to defin...

Drawing image with drawAtPoint (cocoa touch)

Hi, I'm new to objective-C programming for iOS. I'm struggling with a really simple task, drawing an image with code (not just including it in 'interface builder'). Here's the part of my code where I'm trying to put my image into the view: UIImage *image = [UIImage imageNamed:@"Note.png"]; [image drawAtPoint:CGPointZero]; Simple. I ...

How to switch to another view

The following code should work, right? ViewController2 *childView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil]; [self.navigationController pushViewController:childView animated:YES]; [childView release]; It doesn't do anything though. There are no error messages. The view just doesn't get switched. viewD...

How to check a variable's value using a debugger in XCode

How do you use the debugger in XCode to see if a variable is nil? ...

[iPhone] can I create movie manually?

I want to create a movie using objective-c, is it possible? or have to use the camera related things? [Edit]In fact, I want to know is there any API to create a movie, I want to show some pictures in the movie, so I cannot use camera related things. ...

presentModalViewController inside UIViewController class

View *view1 = [[View alloc] init]; [self presentModalViewController:view1 animated:YES]; The code above works when connected to a UIButton. It does not work upon launch of an application by putting it in the viewDidLoad method. I want to run this upon launch. Thanks in advance. ...

How to check if self.navigationController is nil

In the following code, I am able to check with the debugger the values of self and childView. [self.navigationController pushViewController:childView animated:YES]; However, I am not able to see the value of self.navigationController. How can I check if it is nil? ...

Why does self.navigationController become nil?

I have this code: ViewController2 *childView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil]; [self.navigationController pushViewController:childView animated:YES]; I the first line, self.navigationController has a value. On the second line, its value becomes 0. Why is that? ...

presentModalViewController vs. pushViewController

I can show a different view with this code: [self presentModalViewController:childView animated:nil]; This code should do the same thing, right? [self.navigationController pushViewController:childView animated:YES]; But it doesn't do anything. Why is that? ...

pushViewController and Navigation Applications?

Why do Navigation Applications use pushViewController instead of presentModalViewController like all the other apps? How can a Navigation Application be modified to use presentModalViewController instead? Would it be sub-optimal to do so? Why? ...

How does a Navigation-based application get access to the UINavigationController class?

In a Navigation-based application, the method pushViewController:animated can be used. This is a method of the UINavigationController class. However, nowhere in the source files do I see any #import statements that import this class. The documentation doesn't show UIViewController as inheriting from UINavigationController. So how are Na...

Custom Crop Size in UIImagePickerController

I've been struggling with this for awhile now, since there is little documentation on the subject. I have a UIImagePickerController in my iPhone application that I use to select an image to be applied as the background of a view later. This is easy enough to do. Unfortunately, if a user selects a large image from their camera roll it nee...

Xcode: add a string to address book, i dont know how

i dont know anything about obj-C and Xcode, almost nothing, i tried building only with very basic apps... now i have here an app porject source, a friend of mine built partially, and i need to finish it. the only thing i need is to save the string (a telephone number in my case) to the iphone address book this is the var resultText....