objective-c

How-to articles for iPhone development, Objective-C

I am looking for an introduction into developing for the iPhone. Any recommendation? I do not speak Objective-C either, so tutorials on that would not hurt either. ...

Understanding reference counting with Cocoa / Objective C

I'm just beginning to have a look at Objective C and Cocoa with a view to playing with he iPhone SDK. I'm reasonably comfortable with C's malloc and free concept, but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it, but I'm just not over the hump yet. I guess my question is, c...

Cocoa and Objective-C resources?

What are the recommended online or offline resources for Objective-C and Cocoa programming? My online resources: O'Reilly, Some useful articles and examples, but has not been updated for quite a while Learning Objective C, This seems like a good resource so far Late Night Cocoa Podcast, I recently discovered this one, starting on epis...

Accessing iSight programatically?

Is it possible to access the iSight camera on a macbook programatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well? ...

How do you name your instance/param values?

Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables. My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent shadowing of function parameters. However I'm a fan of properties which rules o...

Cocoa - best way to capture key events in NSTextView?

Well? I'm slowly learning Objective-C and Cocoa, and the only way I see so far to capture key events in Text Views is to use delegation, but I'm having trouble finding useful documentation and examples on how to implement such a solution. Can anyone point me in the right direction or supply some first-hand help? Thanks in advance! ...

In Cocoa do you prefer NSInteger or just regular int, and why?

I think the title says it all :) I'm new to Cocoa and while the purpose of many objects is obvious, others are not. For example NSInteger/NSUInteger/NSFloat/NSDouble are all replacements for the regular builtin types. Is there any benefit to using the NS* types over the builtins? Which do you prefer and why? Are NSInteger and int the s...

Drawing a view hierachy into a specific context in Cocoa

For part of my application I have a need to create an image of a certain view and all of its subviews. To do this I'm creating a context that wraps a bitmap with the same-size as the view, but I'm unsure how to draw the view hierarchy into it. I can draw a single view just be setting the context and explicitly calling drawRect, but this...

Objective-C/Cocoa: How do I accept a bad server certificate?

Using NSURLRequest, I am trying to access a web site that has an expired certificate. When I send the request, my connection:didFailWithError delegate method is invoked with the following info: -1203, NSURLErrorDomain, bad server certificate My searches have only turned up one solution: a hidden class method in NSURLRequest: [NSURLReq...

Any ReSharper equivalent for Xcode?

I'm a complete Xcode/Objective-C/Cocoa newbie but I'm learning fast and really starting to enjoy getting to grips with a new language, platform and paradigm. One thing is though, having been using Visual Studio with R# for so long I've kind of been spoiled with the coding tools such as refactorings and completion etc and as far as I can...

What's a 'null defined macro'?

I'm learning objective-C and Cocoa. In the Apple tutorial I'm working through there's a side note that says: IBOutlet is a null-defined macro, which the C preprocessor removes at compile time. I'm curious - what's a null-defined macro? Cheers Ben ...

What's the difference between a string constant and a string literal?

I'm learning objective-C and Cocoa and have come across this statement: The Cocoa frameworks expect that global string constants rather than string literals are used for dictionary keys, notification and exception names, and some method parameters that take strings. I've only worked in higher level languages so have never had to co...

What does the @ symbol represent in objective-c?

I'm learning objective-c and keep bumping into the @ symbol. It is used in different scenarios, for example at the start of a string or to synthesise accessor methods. What's does the @ symbol mean in objective-c? ...

How can I launch the Google Maps iPhone application from within my own native application?

The Apple Developer Documentation explains that if you place a link in a web page and then click it whilst using Mobile Safari on the iPhone, the Google Maps application that is provided as standard with the iPhone will launch. How can I launch the same Google Maps application with a specific address from within my own native iPhone app...

Objective-C: Passing around sets of data

A question that has pondered me for the last while. I am primarily a .net developer who dabbles in Objective-C for iPhone and Mac. How do you go about sending "datasets" between methods in objective-c. For example in C# you can populate a custom class with data and pass it around in a List of type custom class. EG if you had a customer ...

NSEnumerator performance vs for loop in Cocoa

I know that if you have a loop that modifies the count of the items in the loop, using the NSEnumerator on a set is the best way to make sure your code blows up, however I would like to understand the performance tradeoffs between the NSEnumerator class and just an old school for loop ...

Best way to export a QTMovie with a fade-in and fade-out in the audio

I want to take a QTMovie that I have and export it with the audio fading in and fading out for a predetermined amount of time. I want to do this within Cocoa as much as possible. The movie will likely only have audio in it. My research has turned up a couple of possibilities: Use the newer Audio Context Insert APIs. http://developer.ap...

What is the best way to unit test Objective-C code?

What frameworks exist to unit test Objective-C code? I would like a framework that integrates nicely with Xcode. ...

Cocoa tips for PHP developers?

I'm a PHP developer, and I use the MVC pattern, and object oriented code. I really want to write applications for the iPhone, but to do that I need to know Cocoa, but to do that I need to know Objective-C 2.0, but to do that I need to know C, and to do that I need to know about compiled languages (versus interpreted). Where should I be...

Performance difference between dot notation versus method call in Objective-C

You can use a standard dot notation or a method call in Objective-C to access a property of an object in Objective-C. myObject.property = YES; or [myObject setProperty:YES]; Is there a difference in performance (in terms of accessing the property)? Is it just a matter of preference in terms of coding style? ...