uikit

What can be the reason that my UIImageView subclass doesn't receive any touch events?

I have made sure that all superviews of my customized UIImageView and the UIImageView itself have userInteractionEnabled = YES; Also in the nib all views and subviews have userInteractionEnabled = YES; But for some reason, these get never called when I click on the UIImageView: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent ...

What is an "misaligned image" in terms of Core Animation in iPhone OS?

Instruments tells that there are "misaligned images" which are animated by core animation. What does that mean? UPDATE: I've seen that in Instruments.app > Core Animation. ...

What kind of indicators do I have to look at in Instruments app and ObjectAlloc, to see if I have memory leaks in my app?

I guess that the "# Net" column is the most interesting, although I don't really understand what that's supposed to mean. Total number of currently allocated objects? It changes all the time, even if I don't do anything. Are there any good "rules of thumb" to see if there is an memory leak? ...

Will -replaceObjectAtIndex:withObject: of NSMutableArray release the old object that's replaced by a new one?

The documentation doesn't say anything about that. When an old object is "removed" and a new one comes into it's place, then what happens with the old one? Do I have to release it by myself? ...

How can I disable Instruments to automatically launch when I Build&Go to my device?

I've used instruments for searching for memory leaks. I did that through XCode Run > Start with performance tool > Leaks. Then I quit Instruments. And every time I Build&Go, Instruments automatically launches. Although that's cool, when just wanting to test the app, it's not needed. How can I turn that off? ...

Bad performance with core animation and view rotations: How to improve?

I have 12 views which I rotate almost similar to the icons in the home screen when going into homescreen-customization-mode by touching an icon for a few seconds. I use a 3D transformation code to do the rotations. They have each a duration of just 0.02 seconds, and the angle and direction of rotation changes permanently upon accelerati...

What's the equivalent for setting an "identity transform" in 2D space?

For 3D space, I use: self.layer.transform = CATransform3DIdentity; what corresponds here if I just need 2d space and want to assign the identity transform? I knew there was something, but I can't find it anymore. ...

How can I remove the -mthumb compiler flag in XCode?

I've been reading that by default there is an -mthumb compiler flag which reduces code size by 35%. However, in a floating-point calculation intensive app like mine, this is not an good option, like apple says. I'd like to try it out if it changes anything. ...

Is there an way of implementing an minimum deceleration speed in an UIScrollView?

I have an UIScrollView that contains some UIImageViews which are animated. It really only looks cool if there's a minimum scrolling speed happening. But when the user slowly scrolls and lifts the finger, the UIScrollView decelerates very slowly. The problem is, that the scrollViewDidScroll method doesn't get called upon every offset cha...

What does it mean to call initWithFrame on a UIView class or subclass with CGRectZero?

I have seen code that calls initWithFrame of a UIView subclass (such as UILabel) with CGRectZero and things seem to work fine. What does it mean to instantiate a UIView subclass with a 2D point (which seems to be what CGRectZero is)? ...

Why do I have to call super -dealloc last, and not first?

correct example: - (void)dealloc { [viewController release]; [window release]; [super dealloc]; } wrong example: - (void)dealloc { [super dealloc]; [viewController release]; [window release]; } Althoug in alsmost all other cases when overriding a method I would first call the super's method implementation, i...

How can I make an view-based application that does not use a nib file?

I've choosen the "view-based" application template in Xcode. The myProjectViewController.m has the following code: /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ That sounds good. But: The template generated a myProjectViewController.xib file. What I dont get is: How ...

How can I nest a UIScrollView inside a UIScrollView, so that the user can scroll the inner UIScrollView?

I haven't tried that yet, but I assume that I would have to disable scrolling of the parent scroll view as soon as I know that the user will want to scroll in the child scroll view, right? Both scroll views are scrolling horizontal. How could I disable scrolling detection of the parent temporarily? Or is there some other way? ...

View Controllers: How to switch between views programmatically?

In short: I want to have two fullscreen views, where I can switch between view A and view B. I know I could just use an Tab Bar Controller, but I dont want to. I want to see how this is done by hand, for learning what's going on under the hood. I have an UIViewController that acts as an root controller: @interface MyRootController : UI...

How can I dynamically create an instance of an class?

Example: I have 10 view controllers, which are all allocated and initialized in the same way: UIViewController *controller = [[MyViewController alloc] initWithNib]; (note that -initWithNib is a custom method of a UIViewController subclass) The next view controller class is OtherViewController, and so on. I want to load the view cont...

How can I listen for didRegisterForRemoteNotificationsWithDeviceToken outside the app delegate

I would like to my object to receive notification with the DeviceToken becomes available. Is there a way to delegate only certain functions from the UIApplication to my class? Update: I'm not so much interested in accessing it from the application delegate, I already have an application delegate, but want to respond to the event via c...

iPhone: Tracking/Identifying individual touches

I have a quick question regarding tracking touches on the iPhone and I seem to not be able to come to a conclusion on this, so any suggestions / ideas are greatly appreciated: I want to be able to track and identify touches on the iphone, ie. basically every touch has a starting position and a current/moved position. Touches are stored ...

Why is my initWithNib method not called when the view controller is loaded?

I have an class that inherits from UIViewController. There, I want to make some ivar initialization like this: - (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle { // Load the view nib NSLog(@"Hello Earth!"); if (self = [super initWithNibName:nibName bundle:nibBundle]) { self.visibleIndex = 0; NSLog...

How can I exclude a piece of code inside a core animation block from being animated?

I have an core animation block where I call a method that will load a view controller. there is an custom transition between two view controllers happening. However, when the view controller builds up the interface, all this stuff is affected by core animation. Although it results in some interesting effects, I don't want that ;) [UIVie...

How can i connect MySQL database with objective project?

I want to connect MySQl database with my iphone application.Read, write, save some data into the database.How can i do this. ...