Hi all,
First off, you guys are all really helpful - thank you a lot!
Is there a way to figure out what type of network a Mac is connected to? WiFi? Cable? USB Modem? Any Cocoa / Foundation framework I can use to figure that out?
Thank you,
Matthias
...
I'm writing a Cocoa application where I have an auto generated app delegate:(MyAppDelegate.h/MyAppDelegate.m)
So I am not sure of the best way to structure the class files for this Cocoa application. I understand MVC thoroughly (on the iPhone) but I'm having a block as to try organising the source properly in a Cocoa app.
I need to spa...
Hi! Help me please with the following problem:
- (NSDictionary *)getGamesList
{
NSMutableDictionary *gamesDictionary = [[NSMutableDictionary dictionary] retain];
// I was trying to change this on the commented code below, but did have no effect
// NSMutableDictionary *gamesDictionary = [[NSMutableDictionary alloc] init];
// [g...
I'd like to create a dragster/dropzone like dock menu. Looks a bit like a stack with a nsview in it.
After a lot if documentation searching and googling I've found a way to determine a dock icon's location.
(http://cocoadev.com/forums/comments.php?DiscussionID=1431)
Is nzbdrop creating a view which just looks like an stack to display...
My idea is to have a view that is showing the user when something is calculated behind the scenes. It is a view with a height of 30px containing an UIActivityIndicatorView and an UILabel showing what is beeing calculated right now.
I tried to implement it by having a ActivityHandler with these methods:
- (void)newActivityStarted{
[...
It seems that the UIScrollView stops sending touch events to the delegates on the scrollViewDidScroll event. I'm trying to get the y location and can't seem to find access to the events. I would like to update the view based on the position while it's scrolling.
The best lead I've had has been this ( http://github.com/andreyvit/Scrolli...
I have an application designed for iPhone OS 2.x.
At some point I have this code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//... previous stuff initializing the cell and the identifier
cell = [[[UITableViewCell alloc]
initWithFrame:CGRectZero
reuseIdentif...
I'm using cocoa JSON framework http://code.google.com/p/json-framework/
Here is the result of an JSON output that I get. I can see that results in dictionary
Response {
"completed_in" = 0.02461;
"max_id" = 10088639298;
"next_page" = "?page=2&max_id=10088639298&q=apple";
page = 1;
query = apple;
"refresh_url" = "?since_id=10088639298&q=...
All objects used as keys in NS(Mutable)Dictionaries must support the NSCopying protocol, and those objects are copied when they're used in the dictionary.
I frequently want to use heavier weight objects as keys, simply to map one object to another. What I really mean when I do that is effectively:
[dictionary setObject:someObject forKe...
I've got an application with an NSLevelIndicator Object on it that's refusing to update.
I have a timer that's shoved off during init and updates the value of the NSLevelIndicator using its setIntValue method. Whilst the code executes without any exceptions, the NSLevelIndicator never visually updates. I have some other labels on th...
I've worked on a few projects now, and I've had to change the framework search paths, set the bundle loader, etc.
But I've never felt totally comfortable with that Project (or Target) "Get Info" window. I still don't know what half the stuff in there is, and whenever I change anything, there's always a bit of finger-crossing when I clic...
From times to times, while debugging an Application, I see this error on Xcode:
Program received signal: “EXC_BAD_ACCESS”.
and the debugger does not stop on the problematic line. In fact the debugger just shows me a page with a bunch assembly language code and that's it.
I have to have paranormal powers to figure out where the exact ...
I need a way to determine from a Cocoa app if a given process name is running. One idea I had was to use NSTask and poll using ps aux | grep processName. Is there a better solution?
...
I just moved a bunch of code into a separate framework. Nothing has changed in the code since the move and it compiles fine. However, on runtime, It crashes with "misaligned_stack_error". I've been looking around and some people are saying -mstackrealign fixes it, however I have added it to the C flags for both projects in Xcode and it s...
I've got a couple of NSTextFields in my application for entering date and time. They have NSDateFormatters (using NSDateFormatterBehavior10_4) attached to them.
When I change the system date format in System Preferences, then switch back to my application, the text fields automatically update with the new date format, but only if they ...
I've got several different classes in my code utilising identical methods -- resulting in a lot of duplicated lines -- and I recently found out about adding Categories which promises an effective solution to the problem. To give one of the smaller examples, my previous methods were (typically) called in the traditional way like this:
if...
Is there a way to alter the standard background and text colors in cocoa text views throughout the mac os? Since the same text system is used by textedit, mail and other programs, I imagine there is an underlying preference that could be altered. Any ideas how to access it?
Just to be clear, I don't mean simply to alter the document col...
For example, when I call a method that returns an value, but I'm not interested in this at all, can I safely ignore that?
Example, instead of:
CGSize size = [str sizeWithFont:myFont minFontSize:19.0f actualFontSize:&actualFontSize forWidth:150.0f lineBreakMode:UILineBreakModeClip];
...do this:
[str sizeWithFont:myFont minFontSize:19...
So from what I understand the basic application structure for cocoa programs is an AppController in MainMenu.xib. The AppController then initializes the WindowControllers and ViewControllers which has all the UI logic and in turn load the xib files for the rest of the application. The AppController also creates the Model classes.
My co...
I've an application that holds a main window with a list of items, and from that window an undetermined number of windows can be opened. Each of those windows can hold several instances of a model object, with those instances listed in a drawer.
I started my project by making the (main window) list of items extend NSDocument and each ot...