Interface Builder can be used for basic dependency injection in a Cocoa app, but is anyone aware of more complete dependency injection frameworks for Objective-C/Cocoa for when you don't want to instantiate objects in a NIB file?
Edit
To clarify, I recognize that IB can be used for basic DI, but I'm looking for a framework with more co...
I am developing a cocoa application that will be making heavy use of both web services and a standard dbms (most likely MySQL) and I am wondering if anyone has a good option for a database library or ORM solution they have used. CoreData is not an option due to the need to support a standard DBMS and to be able to modify the data outsid...
I have a window that is set with NSBorderlessWindowMask, and also kCGDesktopWindowLevel. When a NSPanel is supposed to appear from say the selection of a Dock Icon menu or a Status Bar Item menu, the NSPanel will not display if the application is not the front most window.
So this program at this time only has a Status Menu Item (think ...
This one is a bit tedious in as far as explaining, so here goes. I'm essentially populating a tableView on the iPhone with multiple sections, and potentially multiple rows per section. To my understanding, it's best to have an array of arrays so that you can simply determine how many sections one has by sending a message to the top level...
I have an init method that takes an (id) argument:
-(id) initWithObject:(id) obj;
I'm trying to call it like this:
[[MyClass alloc] initWithObject:self];
But XCode is complaining about the argument being a "distinct Objective-C type" (which usually indicates a type mismatch or level of indirection error).
If I explicitly...
I'm trying to integrate a NSURLConnection object with UIProgressView, so I can update the user while a file download is happening in the background.
I created a separate object to download the file in the background, and I'm having problems figuring out how to update the progress property in the UIProgressView object with the correct va...
How exactly does NSInvocation work? Is there a good introduction?
I’m specifically having issues understanding how the following code (from Cocoa Programming for Mac OS X, 3rd Edition) works, but then also be able to apply the concepts independently of the tutorial sample. The code:
- (void)insertObject:(Person *)p inEmployeesAtIndex:(...
My Cocoa app needs some small dynamically generated windows. How can I programmatically create Cocoa windows at runtime?
This is my non-working attempt so far. I see no result whatsoever.
NSRect frame = NSMakeRect(0, 0, 200, 200);
NSUInteger styleMask = NSBorderlessWindowMask;
NSRect rect = [NSWindow contentRectForFrameRect:frame st...
I am working on an object factory to keep track of a small collection of objects. The objects can be of different types, but they will all respond to createInstance and reset. The objects can not be derived from a common base class because some of them will have to derive from built-in cocoa classes like NSView and NSWindowController.
I...
Hi,
I have a method in an objective-C class. It has 2 callback functions written in C. The class pointer i.e. self is passed to these functions as void *. In the C functions I create a pointer of type class and assign the void * parameter.
The first callback function executes successfully. But the void * pointer becomes nil in the 2nd ca...
I have some string s that is locale specific (eg, 0.01 or 0,01). I want to convert this string to a NSDecimalNumber. From the examples I've seen thus far on the interwebs, this is accomplished by using an NSNumberFormatter a la:
NSString *s = @"0.07";
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setForm...
What is the best way to load static data files containing game level maps on the iPhone? I have seen some use XML files, but that seems like overkill in my situation as the data files merely determine the layout of the game's level, ie where obstructions will go. Also, what project directory should they be stored in?
Thanks in advance...
I am trying to debug an intermittent error on the iPhone, a crash with a trace that looks like:
objc_message_send
__invoking__
[NSInvocation invoke]
HandleDelegateSource
MainRunLoop
....
When GDB stops, I'd like to be able to determine details about what selector the system is attempting to be invoked - I've set a break point now arou...
I understand that any init... method initializes a new object and that NSString stringWithString makes a copy of the parameter string as a new object. I also understand that being the objects' owner, I can control the release/deallocation of any objects that I allocate. What I don't understand is when would I use the stringWithString met...
In Cocoa, NSTextView has a rather shallow margin between text and border. Is there a way to specify a padding (distance between text and border of view) for a NSTextView without resorting to owner drawing?
...
when releasing an instance that could exist or not, I usually write this:
if (object != nil) [object release];
but since sending a message to nil is not a problem, is that conditional necessary?
I suppose the question comes down to this: which uses more overhead, comparing an object to nil, or sending nil a message?
...
Is there a way using the iPhone SDK to get the same results as an HTTP POST or GET methods?
...
I'm creating an Interface Builder plugin for an NSView subclass. I've been following the Interface Builder Plug-in Programming Guide but it's not answer all my questions. My class has one NSString property and 4 NSColor properties which I want to create bindings for at design time.
I can't figure out where the bindings are specified in ...
I am using cocos2d-iphone to place Sprites onto a Layer to setup a game playfield. At certain points in the game, certain Sprites need to be removed based upon game conditions. What I would like to do is setup an array of Sprite pointers, but I have two questions:
What's the best way to place Sprite pointers in an array?
How does o...
I'm having a weird issue with a particular UITableView in my iPhone devel experience here. If you look at the following screenshot:
you'll notice a strike through going through the middle of the 'Jane Aba' cell.
Any idea what might be causing this odd graphic display? It's true for both the simulator and for the actual device runni...