uikit

How can I solve this Problem with bidirectional dependencies in Objective-C classes?

Okay, this might be a very silly beginner question, but: I've got an ClassA, which will create an child object from ClassB and assign that to an instance variable. In detail: ClassA will alloc and init ClassB in the designated initializer, and assign that to the childObject instance variable. It's header looks like this: #import <Found...

How can I make my Nib load correctly my customized UIScrollView subclass?

I had an nice UIScrollView inside my nib, which worked nicely. Then I had some very special needs and subclassed UIScrollView. In my Nib, I changed the class in the identity inspector to my subclass. But for some reason, my -initWithFrame: method gets never called when the nib loader builds up all those objects from the nib. Actually I ...

In which cases is it a good idea to relinquish using self when accessing instance variables?

This may be a really silly beginner question, BUT: If you have some nice instance variables in your class, such as an UIScrollview *scrollView2 for example, then why should you bypass the getter and setter by relinquishing a [self.scrollView2 addSubview:imageView]; , and rather doing a [scrollView2 addSubview:imageView]; ? I mea...

How would you implement the recycling of views during scrolling in an UIScrollView?

Well, there is the delegate that will get called when: the scroll view beginns scrolling the finger liftet of from the scroll view after initializing a scroll-movement the scroll view stopped decelerating but now the problem is, if you want to recycle those View's upon scrolling, you must do that very quickly during scrolling. Someth...

How do I add a UIButton or UISwitch in tableView:viewForFooterInSection

Hello. I'm trying to understand how to add a label with a UISwitch or other controller to a footer (or header) in a sectioned tableView. Any help would be greatly appreciated. Thank you in advance! ...

How can I rotate a UIImageView with respect to any point (other than its center)?

By default, a UIImageView will rotate only about its center. How do I get it to rotate about any other point in the image? ...

How would you implement a dataSource object for an UIScrollView?

Tell me if I am wrong with that: I made an new class ScrollViewDataSource. That class conforms to an protocol I created within my delegate for the scroll view. Well, it's a very special delegate that does some very complex stuff upon scrolling. So this delegate receives that data source object upon initialization. The datasource object ...

How can I fill an NSArray dynamically?

I have a for-loop. Inside that loop I want to fill up an NSArray with some objects. But I dont see any method that would let me do that. I know in advance how many objects there are. I want to avoid an NSMutableArray, since some people told me that's a very big overhead and performance-brake compared to NSArray. I've got something like...

What's the name of the object, that has an delegate?

The delegate is something like the dog from the "master". I'm thinking about the name for an important instance variable that has to hold a weak reference to this "master" of the delegate. Is there any official name for this? ...

What does the error message "No provisioned iPhone OS device is connected." mean?

Yesterday I testet a lot on my device. Suddenly I get this error message when I hit Build & Go in Xcode. First, it asks me if it's ok to sign with my key. I click yes, and then that error message appears. My iPod is connected as usual, iTunes starts automatically and I close that to prevent interruptions. I tried restarting Xcode. Doesn...

Do I have to run the delegate of an UIScrollView in another thread to prevent performance problems during scrolling?

I'm going to do some sophisticated things in the delegate's methods during scrolling. I'll also implement the dynamic preloading of contents, so that it's theoretically possible to scroll through a few hundret thousand images. But I fear, that every time I do the preloading action for the next big chunk in scrolling direction, the delega...

Is there an easy way to iterate over an NSArray backwards?

I've got an NSArray and have to iterate over it in a special case backwards, so that I first look at the last element. It's for performance reasons: If the last one just makes no sense, all previous ones can be ignored. So I'd like to break the loop. But that won't work if I iterate forward from 0 to n. I need to go from n to 0. Maybe th...

UIImageView and UIImage: How can I tweak the most performance out of them?

First: I've implement a fairly complex scrolling mechanism for images, that allows to scroll over a few hundred thousands (theoretically) in one single scroll view. This is done by preloading small portions upon scrolling, while re-using all UIImageViews. Currently all I do is to assign new created UIImage objects to those re-used UIImag...

Why do my accelerometers respond so slowly?

I'm asking them at 50Hz / 50 times per second for data. When I suddenly flip the device on the x-axis by 90 degrees while the device was flat on a table with display facing up bevore, the values move pretty slowly to the "target" value for that position. Now the weird thing is: If I increase the measurement-rate, the value will move fas...

Is there any good overview graphic of standard view heights in iPhone OS?

I'm often running into the problem, that I don't know how much space I have to place a view. There's 20 units reserved for the status bar. How about tab bar, navigation bar, etc.? Sure I can look that up, but is there any good graphic on the net that shows all those heigths? Let us know! ...

How can I rotate an UIImageView by 20 degrees?

What do I have to do, if I need to rotate an UIImageView? I have an image which I want to rotate by 20 degrees. The Apple Docs talk about an transformation Matrix, but that sounds incredible difficult. Are there any helpful methods or functions to achieve that? ...

Is it important to design iPhone App layouts flexible?

I am wondering if I would run into troubles when setting the heights of my views in the neb with fixed values. Example: The height of the Status Bar is known. It's 20 units. So when making a view that shows an nice interface, what would happen when the user takes a phone call while using the App, and the Status Bar increases in height? ...

How much does an CGAffineTransformMakeRotation() cost?

Is that an very cost-intensive function that sucky my performance away under my feet? I guess they used that one for the waggling buttons on the home screen + core animation. I just want to know before I start wasting my time ;) ...

Can I set the origin of rotation when rotating an view with CGAffineTransformMakeRotation() ?

I have an UIImageView which I want to rotate a little bit, but I need to define an special origin for rotation. How could I do that? More precisely, I have an image of a goblet, and I want it to wiggle on a table. It's socket is quadrate. So when wiggeling to left, then my rotation origin has to be the left corner of that quadrate. And w...

How can I chain animations in iPhone-OS?

I want to do some sophisticated animations. But I only know how to animate a block of changes. Is there a way to chain animations, so that I could for example make changes A -> B -> C -> D -> E -> F (and so on), while the core-animation waits until each animation has finished and then proceeds to the next one? In particular, I want to d...