uikit

Why does my view move around, when I change its center?

I thoght that it's frame's oringin decides the position of the view. But when I change the center property like so myView.center = CGPointMake(myView.center.x - 20, myView.center.y); my view will move 20 units to left. I want to change the center point to make some rotations relative to that point. ...

Why does setting the anchorPoint of the layer's bounds rectangle behave so strange?

I try to set the anchorPoint property, in order to rotate a view by a well defined axis. But: myView.layer.anchorPoint = CGPointMake(myView.layer.anchorPoint.x - 1.0, myView.layer.anchorPoint.y); Wenn I shift it by -1.0, it will not just move 1 unit to left. Instead, my whole view moves by the width of the view to right. What kind of...

Where does apple mention all the important heights of UI components?

Tab bar, navigation bar, tab bar icons, heights of UI controls... I've been reading the Human Interface Guidelines now the whole day, but they rarely mention heights. Do I look in the wrong place? Is there any document from Apple that mentions them in one place? ...

How can I rotate an view based on an rotation origin, whoose position is specified in the view coordinate system?

I find this pretty confusing. When you want to rotate a view, it's going to be rotated by it's center point. But that's not always good. So if you need to rotate by an specified origin in your view, you would have to set the anchorPoint property of the view's layer. Now, the problem is, that this anchorPoint property takes pretty confu...

Changing the delete accessory view in a UITableViewCell

Is it possible to change the view shown in response to a left to right "I want to delete this row" swipe in a UITableView's UITableViewCell? Currently the 'delete' button seems to ignore all of the other UITableViewCell customisation options. ...

How can I make a view get bigger again, as soon as the status bar goes back to normal height after a phone call?

In the simulator I went to Hardware menu and activated the simulation of bigger status bar during phone call. Now, I tried to make a view in my nib that takes up the whole screen. As soon as the status bar gets smaller, I want my view to get bigger, so it uses that space up there. But regardless of any autoresizing settings, my view wi...

How high is a tab bar in iPhone OS?

I tried to get that info, but google returns me just nothing about that. Does anyone know that exactly? I remember a value around 40 units, but I am not sure. The Constants.h of UICatalog.xcodeproj doesn't mention it. ...

What's this (NSNull*)controller == [NSNull null] supposed to do? Why not just controller == nil?

In an Apple example I've seen this: myController *controller = [viewControllers objectAtIndex:page]; if ((NSNull *)controller == [NSNull null]) { controller = [[myController alloc] initWithPageNumber:page]; [viewControllers replaceObjectAtIndex:page withObject:controller]; [controller release]; } I am very interested in this line: ...

Which high quality iPhone video ressources do you know?

I'll start: iTunes U: The famous Stanford University offers the "iPhone Application Programming" courses online. http://itunes.stanford.edu/ I wonder if there are any more great video ressources to know, that have a reasonable quality. ...

What is your iPhone app testing strategy?

Before submitting to the App Store, it is a good idea to test the App once again precisely. I tend to install my App on a device and give it a friend for a while. Then I take the feedback and start changing my app accordingly. I'd like to know what your testing strategies are. ...

What does the UITableView method "deleteRowsAtIndexPaths: withRowAnimation:" do?

***Update to Question***** If the tableview does not affect the model: Are the index path of onscreen cells changed to reflect their actual position OR are the indexes of deleted cells invisible until reloadData is called? **Original Question***** I know it marks the cells for deletion and animates the deletion, but what does it do t...

Model setup for data UITableView that will be filtered using a UISegmentedControl

I am making a UITableView with a UISegmented control ala the Recent Calls tab in the Phone app. The first segment will be all items, the next 2 will be subsets of the full list of items. I created 3 arrays which hold the 3 different lists of data. My first solution was a wholesale swap of the data and the a reload: [self setData:newD...

How does unit testing on the iPhone work?

Do I need special libraries for this, or can I just create a huge class that trys to instantiate every object of my project and test all the methods in there? How's that done in theory? ...

How can I pass the database id of an image to an method, when the corresponding UIImageView is touched up?

I have a grid of UIImageViews. The images names come from a sqlite3 database. When the user selects an image, I need to call a method which will set that image as the preferred one. But to do this, this method must receive the id of the image in the database. Now, I have really no idea how I could achieve that a click on a specific UIIm...

How can I find automatically the coordinates of boundaries inside an PNG with transparency?

Imagine this: I have an PNG image that shows teddy bear, or a triangle. Something non-quadratic. Now, I want to find out, at which point for a given row and direction (coordinates relativ to the UIImageView's coordinate system) the actual visible image starts. Example: Lets say, I need to know where the feet of the teddy bear begins fro...

Custom UIPageControl view, replacing dots with "Page X of Y"

Hello. I'm trying to find a way to replace the dots of a UIPageControl with a caption that reads "Page X of Y" since I'll likely have >50 items. I'm just becoming familiar with Cocoa, and I was wondering what is the best way to do this. Can I subclass UIPageControl? Should I use a custom view with labels? Or something else? Thanks in a...

What kind of data is size_t holding?

In a code-snippet I have seen this: size_t w = CGImageGetWidth(inImage); The docs don't give me any useful info about "size_t". Does anyone know what this is? ...

How can I find out how many bytes one pixel has in an CGImageRef?

The doc is mentioning an CGBitmapContextGetBitsPerPixel(). I am almost sure that I would just have to divide this by 8. But since I didnt study computer science, I am confused about the detail. Would it make a difference if it's an 8 bit PNG or 24 bit PNG? Or some other PNG? So to get securely the bytes per pixel of an CGContextRef, wo...

How can I obtain clean alpha channel information from an PNG image in iPhone OS?

I have created an context like this (simplified): CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate (bitmapData, pixWide, pixHeigh, 8, // bits per component bitmapBytesPerRow, colorSpace, kCGImageAlphaPremultipliedFirst); Now, when I try to extract the data for the fi...

How does the coordinate system in an CGContextRef look like?

I assume that the origin is on the bottom left, and the y-axis expands up, starting from 0. The x-axis expands to the right, starting from 0. I just ask because I get very weird results from my drawing code... want to make sure that I didn't get this part wrong. ...