cocoa-touch

Animation End Callback for CALayer?

Using iPhone CALayer, I want a rotation animation for my spirit layer, but I also want a callback for the animation end, hot to do that? I think maybe I should use CABasicAnimation, but I don't know how to do rotation using CABasicAnimation, any idea? Thanks ...

Manually setting a UIButton state

I UIButton using + buttonWithType: What I need to figure out is how to manually change the button state. There are times when I need it to be set to "disabled." I read through the UIButton documentation but I cannot seem to find anything about manually setting a button state. Any thoughts would be greatly appreciated. ...

Is it possible to prevent an NSURLRequest from caching data or remove cached data following a request?

Hiya, On iPhone, I perform a HTTP request using NSURLRequest for a chunk of data. Object allocation spikes and I assign the data accordingly. When I finish with the data, I free it up accordingly - however instruments doesn't show any data to have been freed! My theory is that by default HTTP requests are cached, however - I don't want...

What is Memory Monitor for the iPhone?

Hiya, I've heard a lot of people talk of a tool called Memory Monitor as a better way to examine the memory usage of an iPhone app as Object Alloc doesn't give an accurate picture of how much memory an app is actually using. How can I launch Memory Monitor? I can't find it in instruments. Is it a part of a separate tool I have to downl...

Are you doing iPhone development? How do you learn?

I am looking for more iPhone developers who are actively posting to their blog and/or Twitter. I have been learning a lot from books but the online resources beyond Apple's developer site have been hard to find. Please let me know if you are doing iPhone development. You can see my comment on Twitter here... http://twitter.com/offwhite...

What's the difference for using CALayer and UIView when do iPhone game development?

For iPhone game development, seems there are very like functions using CALayer and UIView, we can implement our spirit using CALayer or UIView , and animations are usable for them too. But for coding, there are many difference between CALayer and UIView like object methods and properties etc. So which is the better choice? ...

Is there any cocos2d based open-source iphone game exist?

I want to study cocos2d, seems it's a good framework for iphone game programming. So is there any cocos-2d based open-source iphone game exist? ...

How to reduce the startup time for a typical iPhone app?

To be clear, this is for a normal iPhone application, and not a game. I've read around the web a few times some developers mentioning that they were working hard to improve/reduce the startup time of their applications, but never with any good background information on how to do so. So the question is simple: how can you reduce the sta...

Sizing a UILabel to fit?

How would one modify the following snippet (in a tableView:cellForRowAtIndexPath: UITableViewController method) from the "09a - PrefsTable" recipe from Chapter 6 of The iPhone Developer's Cookbook: if (row == 1) { // Create a big word-wrapped UILabel cell = [tableView dequeueReusableCellWithIdentifier:@"libertyCell"]; if ...

iPhone / Cocoa UIDatePicker show only month and day

I'd like to have a UIDatePicker where the user can pick a month and a day but not the year. I'm aware that leap years have an extra day, so for simplicity, let's throw that day away. Is there any way to remove the year column or have 2 reels with month/day that act like the UIDatePicker (grey out days that don't exist in the selected mo...

animate a UIProgressView's change

Is it possible to animate the change of a UIProgressView such that the display will move smoothly to the new value? Kinda like NSProgressIndicator does. ...

Having a UITextField in a UITableViewCell

Hi! I'm trying to do that for a couple of days now, and after reading tons of messages of people trying to do that too, I'm still unable to have a fully working UITextField in some of my UITableViewCells, just like in this example: http://img231.imageshack.us/img231/4858/picture4za3.png Either I have the form working but the text is ...

How to move the buttons in a UIAlertView to make room for an inserted UITextField?

[EDIT] Hmm. Perhaps this question should be titled "what is the default user-input dialog view called in CocoaTouch?" I realize that I can create an entire view that is exactly what I want, and wrap it in a view controller and presentModalView -- but I was sort of hoping that there was a standard, normal user-input "dialog" view that c...

Creating a UITableView with Taller Cells on the iPhone

How can I go about creating a UITableView with taller cells? Basically, I want to create a full screen table with only four cells, but they should take up the entire screen (1/4 each). Assuming this is possible using a UITableView, can it be done both in code and in Interface Builder? And also, can each cell have its own height? --Tim ...

Convert a CGPoint from a UIView coordinate system to a CALayer coordinate system

There are methods to transfer a CGPoint from one UIView to another and from one CALayer to another. I cannot find a way to change a CGPoint from a UIView's coordinate system to a CALayer's coordinate system. Does a layer and it's host view have the same coordinate system? Do I need to transform points between them? Thanks, Corey ...

Display formatted text on the iPhone

I need to display text in an iPhone application, something like the way a book is displayed, for example: Heading Sub heading The actual text of the book. Blah. Blah. Blah. How would I go about doing that? I've found the UITextView and UITextField and UIScrollView objects, but I can't figure out how to use them properly... Any suggest...

How can I pop a view from a UINavigationController and replace it with another in one operation?

I have an application where I need to remove one view from the stack of a UINavigationController and replace it with another. The situation is that the first view creates an editable item and then replaces itself with an editor for the item. When I do the obvious solution within the first view: MyEditViewController *mevc = [[MYEditViewC...

Limiting text in a UITextView

I am trying to limit the text input into a UITextView in cocoa-touch. I really want to limit the amount of rows rather than the number of characters. So far I have this to count the amount of rows: - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if([text isEqualToStri...

What happens to an iPhone app when iPhone goes into stand-by mode?

My app uses NSTimer and it appears that NSTimer doesn't fire when the iPhone goes into the stand-by mode (either by pressing the hardware button or by the idle timer). When I activate the iPhone again, my app is still in the foreground. What happens to third party apps when the iPhone is the stand-by mode? ...

Downloading image with a variable URL?

I am new to this, so please dumb it down for me. I have been tinkering with Objective-C for an iPhone app and have hit a road block. I am trying to pass the value contained in a variable (string) to a method but it doesn't work. I am guessing it is because the variable is probably a pointer to the value, not the value itself. I wonder ...