cocoa-touch

How can I get a precise time, for example in milliseconds in objective-c?

Is there an easy way to get a time very precisely? I need to calculate some delays between method calls. More particular, I want to calculate the speed of scrolling in an UIScrollView. ...

Adding UIControl subclass in loadView crashes iphone app

Hi all, I'm new to iphone and experimenting with the platform. I have a root view controller which loads it's view from a nib. I accidentally uncommented the 'loadView' method in this class, and now the app crashes - is this because if a view controller is initiated from a nib then you can never have a loadView implementation? Taras ...

how to customize uitableview

Hi, I need to customize each cell in a UITableView (like each cell will have UITextfield and UIButton). Could you let me know if there is any good article on that? Thanks. ...

Animate the drawing of a line (Quartz 2D?)

How would you go about animating the drawing of a line in a UIView on the iPhone? Is this possible? It can be drawn but can it easily be animated so it appears to be hand drawn? ...

How do you restart a query using NSFetchedResultsController

I'm finishing up the Core Data tutorial, and it suggests trying to convert to using a NSFetchedResultsController. So I've got it so that I can query the existing data, but when I add a row at the beginning, tableView:cellForRowAtIndexPath calls NSFetchedResultsController.objectAtIndexPath, but that still returns the old zeroth object in...

What kind of logarithm functions / methods are available in objective-c / cocoa-touch?

I've tried searching for logarithm + objective-c, but all I get is math test pages from teachers, or explanations what a logarithm is ;) I've got some measurements that are like 83912.41234 and others are 32.94232. I need to press down this huge spectrum into something between 0 and 100, and that 32.94232 would habe to be at least somet...

iphone cocoa : how to drag an image along a path

I am trying to figure out how can you drag an image while constraining its movement along a certain path. I tried several tricks including animation along a path, but couldn't get the animation to play and pause and play backwards - so that seems out of the question. Any ideas ? anyone ? ...

Override Interface Builder instantiation of objects?

I'm developing for the iPhone, and I have a class DataManager, that is used to maintain my application data. When the application launches/exits, the data is read from/written to disk to create an instance of this class, using the NSKeyedArchiver (and Unarchiver) classes, since the DataManager adheres to the NSCoding protocol. One probl...

CFAttributedString on the iPhone

Hi, Is it possible to use the CFAttributedString type to draw formatted text on the iPhone? I see it in the documentation, but I can't figure out how to actually draw it to a context. Thanks, Kyle ...

viewDidLoad gets called, viewWillAppear does not get called, view does not appear on screen.

Update It has been mentioned that viewWillAppear and viewDidAppear do not get called per the docs. However, I perform no initialization within these methods and no adding UI elements to the view. I was just using them to place break points to try to debug this. Any other ideas? Original Question I'm stumped. I'm refactoring some c...

iPhone table cells: how to get them transparent and complex

Hi! I would like to build a table that looks almost exactly as the one in the iPhone's contacts app. When you click on a contact it shows the information related. The biggest problem comes when I try to build that: a table with complex cells, with transparent cells and cell with two buttons. How would you do that? Thanks! ...

iPhone equivalent of -doCommandBySelector:?

I want to push something onto the iPhone's responder chain. That is, I want to send a selector to a UIResponder subclass and, if it doesn't respond to said selector, have it pass it on to its nextResponder. Any thoughts? ...

next-previous with large number of views

I am trying to manage 18 different views. How can I handle next-previous functionality for each view in an efficient way with this many views? ...

Advice on High Score persistence (iPhone, Cocoa Touch)

Hi. I was curious what is considered the better way to manage the reading and writing of a High Score plist file. My High Score class is: @interface HighScore : NSObject <NSCoding> { NSString *name; int score; int level; int round; NSDate *date; } Now, I could do method A, add NSCoding methods: - (vo...

C++ struct member, what type to keep calendar time on iPhone?

I need to keep datetime in a C++ structure for an iPhone app. The time will be saved and restored into sqlite db. What is the best data type and corresponding API for this? My candidates are: time_t and struct tm from <ctime> and <time.h> NSTimeInterval from <NSDate.h> TimeValue from the QuickTime API My instinct is to go with the g...

iPhone UITableView cells stay selected

Hi, in my UITableView sometimes cells stay selected after touching. Because it happens only occasionally, I'm not able to reproduce the problem. Any hints? Maybe it has something to do with unproper releasing of tableView? - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSUI...

What's the easiest way of using SQLite3 in iPhone-OS?

I've heard that it's a bad idea to use plain SQLite3 in an iPhone project. Which frameworks, libs, wrappers, etc. do you use? Which are worth looking at? ...

Using a object across multiple view controllers

I have been attempting to have a object that I can use across multiple view controllers by following this thread. http://stackoverflow.com/questions/851158/one-instance-across-multiple-views But it has not been working for me. So I started with the basics to see what was going on. I created a local instance of the object. PlayerDa...

NSSet and NSCountedSet, when is the best time to use them?

These two collection types are rarely used by me as I'm typically using their counter parts, NSArray, NSDictionary and the equivalent mutables. I have a feeling I'm missing out on a collection which can act much faster than the other two in certain situations. When is the ideal time to use these and how? ...

Ist it a good idea to use NSUserDefaults to store the latest state of an iPhone application?

I have an view-based application where the user can do a lot of customization things, like selecting colors, selecting pictures, and so on. First, I thought about using sqlite3 for that, but since this would result in a table with only one row (no multi-user app), it seems like a big overhead to me. Then I heard about NSUserDefaults. Bu...