Browsing Questions About cocoa (1)



Understanding reference counting with Cocoa and Objective-C

I'm just beginning to have a look at Objective-C and Cocoa with a view to playing with the 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 ove…

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 Pod…

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

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 som…

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 yo…

In Cocoa do I need to remove an Object from receiving KVO notifications when deallocating it?

When I've registered an object foo to receive KVO notifications from another object bar (using addObserver:...), if I then deallocate foo do I need to send a removeObserver:forKeyPath: message to bar in -dealloc?

Why is the PyObjC documentation so bad?

For example, http://developer.apple.com/cocoa/pyobjc.html is still for OS X 10.4 Tiger, not 10.5 Leopard.. And that's the official Apple documentation for it.. The official PyObjC page is equally bad, http://pyobjc.sourceforge.net/ It's so bad it's baffling.. I'm considering learning Ruby pr…

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 contex…

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 hi…

Developer Setup for Starting Out with Cocoa/Mac Programming

I'd like to start experimenting with Cocoa and programming for Mac OSX. I'm not terribly concerned with Objective C syntax/constructs/bheaviors at this point, but more curious as to an efficient setup on in terms of an editor and/or IDE that will get me going quickly. Is there any IDE even remotel…

Height of NSTextView with one line?

I want to programatically create an NSTextView. How can I determine the correct frame height so that the view displays one line of text in the current default font?

Can you use CruiseControl to build Cocoa/Objective-C projects?

Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project? If so, is there a preferred flavor of CruiseControl (CruiseControl.rb or just regular CruiseControl) that would be easier to do this with. I currently have a Ruby rake file that has steps for doing building and…

InputManager on OS X

I was wondering if InputManagers are still part of Leopard and if there is a good example that would show me what are the use of it?

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 t…

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

Next Page >