Hi,
I have an NSDate and I want to tell if it occurs on a particular day of any year. How do I do that?
For instance, I want to see if NSDate's day and month are 25 and 12.
I want to go:
NSDate *today = [NSDate date];
int day = [today day];
int month = [today month];
Is there a way of doing that?
...
I'm interested in using rangeOfString with some wildcard characters as part of a search string.
For example, if I have several strings like "244px" and "356px" and I want to convert all such strings to "320px". Is there a way I can use wildcards to get the desired result?
...
I would like to enable the grayed out open file menu item within a non-document-based application. Document-based applications automatically give you a nice open file dialog with file extension filters based on plist entries etc... Surely, a simple elegant method exist to re-enable this functionality.
I have...
Added document types to...
In trying to learn the very fundamentals of menu handling. My test app's menubar has 3 menus -- namely "TestApp", "File" and "Help". I find I can remove these menus entirely, simply by calling say:
NSMenu* rootMenu = [NSApp mainMenu];
[rootMenu removeItemAtIndex:2];
However, I'd only ever want to temporarily disable them (gray them ou...
Hi,
I am developing an application in cocoa which shows a view with two NSTextfields and two NSButtons.To enable tab keystroke the next key view is set to next control(From NSTextfield1 to NSTextfield2 then from NSTextfield2 to NSButton 1 then from NSButton1 to NSButton 2 then NSButton2 to NSTextfield1).But the problem is i am able to na...
I have a little Cocoa Application that needs to save its settings. Is it the best practice to save every time to user made a change or is it better to save once only when the application is ended?
Is there any event raised when the application should end or the window should close?
...
Let's say I have the following situation:
When I select different rows in the NSTableView, it magically updates the NSArrayController (PersonController) selection. How is the NSTableView doing this? Does it do something like this:
- (void)bind:(NSString *)binding toObject:(id)observableController withKeyPath:(NSString *)keyPath optio...
Firefox doesn't currently bounce the Downloads box in the dock when a download is finished, like Safari, Chrome and Camino do.
If Firefox was written in Objective C, you could very easily add the one line of Objective C code required to do this. However, it's not. Is there a way to call this Cocoa function from C++ so that it can be a...
Hellow stackoverflow people,
I am pretty new to Cocoa. I have XCode 3.1
Situation:
I have a NSObject subclass: (AppController) with an action, linked to a button.
Than i have a custom View, connected to my NSView subclass (AppView), in the drawRect command i draw a rectangle (all that stuff works),
i have in the AppView.m a function - (...
I´m new in iPhone development and I have this memory leak.
I´m using an NSMutableArray to retreive the content of a .plist file located in the Documents directory.
The first time I use it, everything goes fine, but if I call it several times I get a memory leak.
This is my code:
- (void)viewWillAppear:(BOOL)animated {
[super viewWi...
Hey guys!
I want to build a NSTokenField that works just like the recipient field in Mail.app. I know how to search the address book for names and emails. These are probably really bad noob questions, sorry for that.
How can I reformat my search results array to get items in the format "Name <email>" (like the auto completion results i...
Hi, with GUI apps I mean not just a Unix command line application, but the whole .app bundle and a full Cocoa or Carbon application.
Thanks!
PS: I wasn't totally accurate with GUI application.
I meant an application with a window and a menu, as opposed to a Unix command line application.
Actually I got to a tutorial about programming wi...
Does somebody else has randomly seen crashes in ASIInputStream forwardInvocation: during the use of ASIFormDataRequest? (the request was startAsynchronous)
Here is the backtrace:
#0 0x95877b83 in CFRunLoopSourceSignal ()
#1 0x958daa45 in _CFStreamScheduleWithRunLoop ()
#2 0x9588d05d in __invoking___ ()
#3 0x9588cfc8 in -[NSInvocati...
I'm facing a problem for an application I'm writing (http://code.google.com/p/blazingstars/issues/detail?id=25), where my program is a menulet (menu bar) application that uses the Accessibility API to interact with and control another program. I do the usual things like registering for the API notifications and getting the window list t...
I previously posted this question as a comment on a related thread thinking it was simple. That thread is here:
http://stackoverflow.com/questions/670202/cocoa-binding-to-a-particular-item-in-an-array-controller/2082309#2082309
The questions relates to (and I'll more fully describe it here) a game I'm building to try and learn objec...
Hey People^^
Situation:
Noob / Xcode 3.1
I have an AppView (NSView subclass) and an AppController (NSObject subclass)
in AppView.h i declare a boolean (BOOL: booleanDraw), which i set to 'NO' in AppView.m
When a button is clicked it 'launches' an action (AppController .h/.m) now i want to change booleanDraw to YES when the button is ...
Hey i was searching for a solution for my problem and i nearly have it just one tiny bit...
I have a NSView subclass (AppView) and a NSObject subclass (AppController)
In AppView i declare a boolean with the @property than i use @synthesize and than in AppController i want to access it: i found this:
(in the implementation)
AppView *ob...
In my header file, I have this code:
@interface TableViewController : UIViewController
{
IBOutlet UITableView *tblListData;
NSArray *arryData;
}
In my class declaration file, I have this implementation:
- (void)viewDidLoad
{
arryData = [[NSArray alloc] initWithObjects:@"iPhone",@"iPod",@"MacBook",nil];
[super viewDi...
On Mac OS X using Objective-C 2, plugin bundles can be compiled with one of three garbage collection settings:
Not Supported
Supported (-fobjc-gc)
Required (-fobjc-gc-only)
How can one programmatically query a compiled plugin bundle to determine which of these three settings was used?
...
I'm trying to get a listing of machines in my local domain, specifically ones running a administrative web service (_asip-webadmin). I've been fooling with NSNetService but it would seem that it's only good for Bonjour listings (as I can trap them just fine). I've tried something along the lines of:
[mySearch searchForServicesOfType:@"_...