cocoa-touch

Why should I use an CATransaction in an animation?

I've found this code snippet: [self setValue:direction forKey:@"currentDirection"]; CAKeyframeAnimation * animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; animation.path = path; animation.duration = grids * gridWidth / [self speed]; animation.fillMode = kCAFillModeForwards; animation.removedOnCompletion = NO; animati...

Prompting and Delegate question

I have a class that needs to ask the user a question and wait for the users response to determine the next action. What would be the best way to do this? Using a delegate? How? I have a UITextField and a UITextField in the class. Thanks ...

Moved my viewController under a NavController and now awakeFromNib and initWithCoder don't fire?!?

I have a somewhat complex view that I put together in a separate (View-based template) project (the View Controller was represented with orange icon in MainWindow.xib). It's far enough along now that I've decided to move it into another project where it will be managed by a Navigation Controller. It is called from UINavigationController'...

Custom View in UITableViewCell

I am trying to create a UITableView Section that contains two buttons aligned horizontally. This would be similar to the Contacts app, where on the bottom of a specific contact page they have buttons lined up to Text the contact and share the contact. However in my tableView, I want the two buttons to be placed in between other section...

Why should I use KVC rather than the simple dot syntax when accessing object properties?

There's the option to go the long way, if an receiver class conforms to the NSKeyValueProtocol: [myInstance setValue:[NSNumber numberWithInt:2] forKey:@"integerProperty"]; or the short way: myInstance.integerProperty = 2; what's the point of this KVC method? When is this useful? ...

Automatic Tab Switch

Hi all, I'm building an iPhone application with a UITableView. On selecting a row a web page is loaded in a UIWebView in the next tab along. Currently this is all working, however, how can I set the application to automatically move into the tab where the webpage has been loaded into the UIWebView? Is there some form of animation that ...

Change the position of the left UIImageView in a UITableViewCell in OS 3.0

Hello, I have a UITableView with standard UITableViewCells that contain an image on the left. I'm setting the image of the cell as follows: UIImage *leftIcon = [UIImage imageNamed:@"myImage.png"]; cell.imageView.image = leftIcon; This works fine. However, there's a difference in appearance depending on which iPhone OS the App runs. ...

How could Apple know that an iPhone app makes use of hidden API?

I wonder if they have any fancy tools that detect usage of hidden API. Does anyone know? ...

Can't get landscape bounds for modal UIViewController

Hi, I have a landscape view which is activated via listening for orientation notifications and then presenting a modal view controller. However, it's giving me some grief. It seems whatever I do I just can't seem to get landscape bounds. super.view.bounds is {{0, 0}, {320, 480}} portrait, even though it is drawing at the correct orien...

How can I use CIFilter in iPhone OS?

Apple says that CIFilter is available in iPhone OS. However, on my mac I couldn't find an CoreImage framework to link against. filter An optional Core Image filter object that provides the transition. @property(retain) CIFilter *filter i.e. when I try to do something like this, it crashes because CIFilter is unknown: [trans...

searchDisplayController: change the label "No Results"

Hello, how do I change the label "No Results", when using a searchDisplayController? Regards ...

removeFromSuperView / memory/ dynamic view switching

I have implemented a large list of views in a UIScrollView. I cannot use a table view because of the nature of my app. Basically I have a collection of 'blocks' which are view controllers themselves, inside a UIScrollView. Everything is working OK but memory is a problem on very large pages. I have successfully implemented dynamic ad...

How to specify an beginTime for an animation by using CFTimeInterval?

For my understanding, beginTime can be used to say "hey, start at exactly 12:00 'o clock". But how would I tell this with an CFTimeInterval type? I thought that this one is nothing more than a kind of "float" value to specify seconds. Or what else would be then the difference to the timeOffset property that is specified in CAMediaTiming...

MKMapView Zoom and Region

I'm familiar with using google maps javascript api. Recently I started using mapKit framework for an iphone project, but I'm having a hard time to figure out zooming and setting a region on map. In google maps api I used to use integer zoom levels like 8, 9, 10 along with straightforward function setZoom(). The only equivalent method I ...

Objective C Threading Question

Here's the code: for(int i = 0; i < personListViewController.peopleCount; i++) { [NSThread detachNewThreadSelector:@selector(getPerson:) toTarget:self withObject:i]; } getPerson looks like this: - (void)getPerson:(int)whichPerson { } When I build this, I get the following :warning: passing argument 3 of 'detachNewThreadSelector:t...

What does fillMode do exactly?

The documentation is not talking really much about what this technically does. fadeInAnimation.fillMode = kCAFillModeForwards; I don't really see the effect of this. I have an view with alpha set to 0.0. Then I fade it in. But when I uncomment the line abouth, nothing changes. Same behavior. I'd like to understand what this fillMode r...

showsUserLocation with Location Services disabled

I have an MKMapView in my app and have a button that turns on showsUserLocation for the map, while the map is finding the location I display a spinner so the user knows its working. I know when to stop the spinner by adding NSKeyValueObserver to the map's userLocation property. However if the user has Location Services disabled then the ...

Why is this over-releasing? UINavigationController / UITableview

I'm pushing a view controller onto my navigation controller's stack from within my TableViewController's didSelectRowAtIndexPath method as so: MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] de...

Cocoa (OSX) and CocoaTouch (iPhone) components in the same Xcode project file?

Is it possible to have an Xcode project file which contains both the Cocoa (MacOSX) and CocoaTouch (iPhone) versions of a component? I thought I was getting close until I realized that you need to set "Base SDK for All Configurations" in the Project Settings in order for the cross-compiler to be called (and for any CocoaTouch frameworks...

Cocoa Touch: Accessor method + memory needs clarification

Please consider a problem constructing an array and returning it to a parent object. Please have a look at my code and comments below. My question is: Why does method THREE work while methods ONE and TWO do not? // **************************** // Master.m // **************************** // Simply declare array and call accessor NSMut...