objective-c

How much does it cost to develop an iPhone application?

How much can a developer charge for an iPhone app like Twitterrific? I want to know this because I need such an application with the same functionality for a new community website. I can do Ruby but have no experience with Objective-C. So it would be interesting for me if I should start reading books about iPhone programming or outsourc...

Hidden features of Objective-C

Objective-C is getting wider use due to its use by Apple for Mac OS X and iPhone development. What are some of your favourite "hidden" features of the Objective-C language? One feature per answer. Give an example and short description of the feature, not just a link to documentation. Label the feature using a title as the first line. ...

UUID mismatch detected with the loaded library

I get a "UUID mismatch" warning at the console when I try to build and run my app on my iPhone. warning: UUID mismatch detected with the loaded library - on disk is: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/lib/liblockdown.dylib =uuid-mismatch-with-loaded-file,file="/Developer/Platforms/iPhoneOS...

Right way to implement TouchesMoved ?

I have a custom UIView that generates a set of subviews and display them in rows and columns like tiles. What I am trying to achieve is to allow the user to touch the screen and as the finger move, the tiles beneath it disappears. The code below is the custom UIView that contains the tiles: - (id)initWithFrame:(CGRect)frame { if ...

How do I create a temporary file with Cocoa?

Years ago when I was working with C# I could easily create a temporary file and get its name with this function: Path.GetTempFileName(); This function would create a file with a unique name in the temporary directory and return the full path to that file. In the Cocoa API's, the closest thing I can find is: NSTemporaryDirectory A...

UIView scale to 0 using CGAffineTransformMakeScale

Is it possible to scale a UIView down to 0 (width and height is 0) using CGAffineTransformMakeScale? view.transform = CGAffineTransformMakeScale(0.0f, 0.0f); Why would this throw an error of "<Error>: CGAffineTransformInvert: singular matrix." ? Update: There is another way of scaling down a UIView to 0 [UIView beginAnimations:n...

How can replace the string [Foo alloc]<cursor> with [[Foo alloc]<cursor>] in XCode?

Is there a key shortcut for this in XCode? Can I implement an Applescript for this and run it within XCode? ...

Best way to use XML-RPC in Cocoa application?

Hi, I wanted to write a GUI-wrapper for an application which uses XML-RPC and wondered if there are any XML-RPC frameworks available for Cocoa and if so what's the best? Thanks in advance ...

How do you print out a stack trace to the console/log in Cocoa?

I'd like to log the call trace during certain points, like failed assertions, or uncaught exceptions. UPDATE: Thanks for the answers.. followup question... how do you do the same in a thread other than the main thread? Neither method properly displayed the stack in such a case. The output is nonsensical wrt to the current context. Ho...

Calling performSelectorOnMainThread => Multithreaded app?

I noticed that the following banal call from my main thread [self performSelectorOnMainThread:@selector(rollBar:) withObject:nil waitUntilDone:false]; was causing [NSThread isMultiThreaded] to report that my app had become multithreaded. I thought that was only supposed to happen when you detach a thread, something that qu...

Changing the background color of a UILabel within a UITableViewCell

A UITableViewCell comes "pre-built" with a UILabel as its one and only subview after you've init'ed it. I'd really like to change the background color of said label, but no matter what I do the color does not change. The code in question: UILabel* label = (UILabel*)[cell.contentView.subviews objectAtIndex:0]; label.textColor = [UIColor ...

Using a UITableViewController with a small-sized table?

When using a UITableViewController, the initWithStyle: method automatically creates the underlying UITableView with - according to the documentation - "the correct dimensions". My problem is that these "correct dimensions" seem 320x460 (the iPhone's screen size), but I'm pushing this TableView/Controller pair into a UINavigationControll...

Set Appointment using iPhone SDK

I know you can access the Contact Store from the SDk, but is it possible to create and read appointment data? ...

What are the exact rules for structure alignment on iPhone OS?

I'm using the Objective-C NSMethodSignature / @encode facilities to do some cross-language data type translation, which means that I need to be able to programmatically copy values into a structure described in @encode() format. e.g., I may have 4 floats and need to insert them into a CGRect, which is a structure containing 2 structures...

How do you move a CALayer instantly (w/o animation)

I'm trying to drag a CALayer in an iPhone app. As soon as I change its position property it tries to animate to the new position and flickers all over the place: layer.position = CGPointMake(x, y) How can I move CALayers instantly? I can't seem to get my head around the Core Animation API on the iPhone. Thanks a lot.. ...

How do I create blurred text in an iPhone view?

I am building up a view with various text and image elements. I want to display some text in the view with a blurry copy of the text behind it, but not just a text shadow. How do I apply Gaussian blurred text onto a UIImage or layer? ...

Can you detect a ctrl-click (context menu) request in the mouseDown event?

In my cross-platform architecture, I would like to act on a context menu click (right button click) during a mouse click event. In Cocoa, can you detect that the user either Ctrl-Clicked or double-tapped on touchpad (right-click equivalent) DURING the mouseDown event? I am aware of NSView's menuForEvent but do not wish to handle it her...

Obtaining the maximum height of a font

So I have an NSFont, and I want to get the maximum dimensions for any characters, ie. the pitch and letter height. [font maximumAdvancement] seems to return an NSSize of {pitch, 0}, so that's not helping. Bounding rect doesn't seem to work either, and the suggestion from jwz's similar question of creating a bezier path, appending a gly...

Encryption with C# and Objective-C

What's a good encryption algorithm that will allow me to specify a password to encrypt text? I'm assuming the standard algorithms out there will work cross-platform but I do need the algorithm to work in C# and Objective-C - is anyone familiar with any samples for Objective-C? Thanks ...

Best Cocoa/Mac OS X programming blogs?

What are the best Cocoa/Mac OS X programming blogs? One blog per answer please. blog should be active (i.e. updated regularly and recently) blog should have code-centric posts (although not all) ...