cocoa-touch

I can't seem to get the new iPhone media player framework to work

I'm working in the 3.0 SDK so I can't use specifics, but anyone who is using it might understand, I hope. I have been trying to load a view that allows you pick from a particular list of items...but I can't get it to work here's the code I'm using, made to be generic: M**********Controller *newpicker = [[M**********Controller alloc] ...

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. ...

Cocoa Foundation Kit question - NSDecimalNumberBy...:withBehavior:

I'm trying to take a numeric value in a string and raise it by a power of 10. stumbled upon – decimalNumberByMultiplyingByPowerOf10:withBehavior: which looks promising but I can't for the life of me figure out how to configure/set the withBehavior argument. I think I need to set it to NSRoundDown so when raising to negative power it ...

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...

UITextField - Did End On Exit Event

How do I programmaticly assign a method (Observer?) to the "Did End On Exit" Event on a UITextField object? This is easy enough to do in IB but I can't figure out how to do it in code... ...

How to resolve 'unrecognized selector sent to instance'?

In the AppDelegate, I'm alloc'ing an instance defined in a static library. This instance has an NSString property set a "copy". When I access the string property on this instance, the app crashes with 'unrecognized selector sent to instance'. Xcode provides a code hint for the property, which means it is known in the calling app. The ...

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...

iPhone: How to load a View using a nib file created with Interface Builder

Hi I'm trying to do something a bit elaborate but that should be possible, so here is a challenge for all you experts out there (this forum is pack of the lot of you :) ). Im creating a Questionnaire "component" I want to load on a NavigationContoller my QuestionManagerViewController. This is an "empty" view controller that can load di...

Stop UITextView from jumping when programatically setting text

Hi there, I have to update a small amount of text in a scrolling UITextView. I'll only be inserting a character where the cursor currently is, and I'll be doing this on a press of a button on my navigation bar. My problem is that whenever I call the setText method of the text view, it jumps to the bottom of the text. I've tried using c...

How do I create a UIBarButtonItem with multiple "sections"?

I would like to create a UIBarButtonItem on my iPhone application which has two "sections". Basically I would like to have functionality equivalent to the 'Today', 'This Week', and 'All' buttons that's in the 'Most Viewed' section of the YouTube iPhone app. It doesn't look like this functionality was accomplished with multiple UIBarBu...

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? ...

What's this {{0,0},{w,h}} doing?

I stumbled upon this piece of code today: CGRect rect = {{0,0},{w,h}}; Here, I would have used a CGRectMake. But what does this thing in rambled brackets do? What kind of special-syntax is that? None of my objective-c books ever mentioned that. ...

Change uitablelview properties in subclass in viewdownload method in cocoa?

I've been following a tutorial that manipulates a uitableview from a uiviewcontroller to generate nicely styled cells. I was wondering is it possible to do same to a class that subclasses uitablewcontroller instead of uiviewcontroller. The user uses code like: tableView.rowHeight = 50; tableView.backgroundColor = [UIColor clearC...

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...

Getting UUID through SDK

Does the SDK provide an API for retrieving the current phone's UUID? ...

how to use paragraph text in uitableviewcell in cocoa-touch

I've been using uiLabels to put text in the cells of tableviews. I want to now use paragraph text that carriage returns to the next line instead of going out of the boundaries of the table cell. Would I do this by manipulating a uiLabel or would I use a different control all together like a text view. Also is there any project example...