I have an application that is an NSStatusItem.
It has a few different modes, each of which require an external process to be launched, during which the icon is simply highlighted, and appears to be frozen.
I want to use the -setImage: method (or reasonable facsimile) to display something along the lines of a "spinner" commonly seen in ...
Hi, I have a Cocoa application managing a collection of objects. The collection is presented in an NSCollectionView, with a "new object" button nearby so users can add to the collection. Of course, I know that having a "delete object" button next to that button would be dangerous, because people might accidentally knock it when they mean...
Hello everyone!
I'm always really picky about memory leaks and I cannot understand why my garbage collected application leaks. My code is entirely memory-managed and it runs great without garbage collection, not a single leak. However, as soon as I turn on garbage collection it leaks!
Just to prove a point, why does this leak in a garb...
Hey guys, I am grabbing a JSON array and storing it in a NSArray, however it includes JSON encoded UTF-8 strings, for example pass\u00e9 represents passé. I need a way of converting all of these different types of strings into the actual character. I have an entire NSArray to convert. Or I can convert it when it is being displayed, wh...
I create a rightBarButtonItem with this method :
- (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback {
UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f);
return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease];
}
At exec...
Ok guys I am developing an iPhone app I have a Model class which follows a Singleton design pattern.
Now I have an NSArray in it which is initialized to around some 1000 NSStrings in the init method.
Now I need to use this data in some view controller. so I import Model.h, I create an array of NSString objects in view controller & set ...
Short & sweet version of my last question in light of new information.
I have a UIVIew with an init and a drawrect method (and another thread and a bunch of other stuff, but I'll keep it short & sweet).
All of the class variables that I alloc and init in the -(id)init method are out of scope/nil/0x0 in the drawRect method, and I am una...
I can open a Terminal tab using the following AppleScript:
tell application "Terminal"
set myTab to do script "exec sleep 1"
get myTab
end tell
This returns a string like: tab 1 of window id 3263 of application "Terminal". This is great, I can see the window id 3263 and tab number 1 (although I don't know how to query myTab to...
I have some questions about this window:
What type this window is (I've found that only "Textured Window" has rounded bottom corners)?
Why it doesn't have a title? Could I add it?
How to add a label to the title (word counter).
How to add a bottom bar?
...
I wrote a menu application that has no persistent window or standard menu. When another application has focus and I use the menulet to trigger a window to be opened, it appears behind the foreground application (but above anything else that is present on the screen).
Basically...
-(IBAction)aboutWindow:(id)sender {
[NSBundle loadNi...
Imagine I create and execute an NSThread object using detachNewThreadSelector:toTarget:withObject:. The method executed by the thread might look like this:
- (void)search {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// perform a lengthy search here.
[pool release];
}
I then might use the cancel method to...
This is what happens when I create an NSProgressIndicator and use NSStatusItem's -setView: method to display it in the menubar area while I'm performing an action:
What causes this border to be displayed, and how can I remove it? The intended result is that the control be transparent.
Here's the code I'm using:
NSProgressIndicator *...
Say I have a tableview class that lists 100 Foo objects. It has:
@property (nonatomic, retain) NSMutableArray* fooList;
and I fill it up with Foos like:
self.fooList = [NSMutableArray array];
while (something) {
Foo* foo = [[Foo alloc] init];
[fooList addObject:foo];
[foo release];
}
First question: because the NSMutableAr...
Note: It's probably worth scrolling down to read my edit.
I'm trying to setup an NSTimer in a separate thread so that it continues to fire when users interact with the UI of my application. This seems to work, but Leaks reports a number of issues - and I believe I've narrowed it down to my timer code.
Currently what's happening is that...
Hi, I hope somebody can help with my notification problem. I have a notification which looks to be set up correctly but it isn’t delivered as expected. I am developing a document based app. The delegate/ document class posts the notification when it reads from a saved file:
[[NSNotificationCenter defaultCenter] postNotificationName:n...
I have an NSTextField into which I need the user to enter a number between a max and min, and it would be nice if I could detect when the NSNumberFormatter fails that particular test so I can either display a nicer message ("The number is too large" is not very helpful, it needs to display the valid range) or simply set the field automat...
I'm trying to get the DOE,JOHN from the below NSString:
IDCHK9898960101DL00300171DL1ZADOE,JOHN
I was trying to split the string on 1ZA, as that will be constant.
Here's what I've tried so far, but it's giving me the opposite of what I'm looking for:
NSString *getTheNameOuttaHere = @"IDCHK9898960101DL00300171DL1ZADOE,JOHN";
// sca...
I currently have an NSView that draws a grid pattern (essentially a guide of horizontal and vertical lines) with the idea being that a user can change the spacing of the grid and the color of the grid.
The purpose of the grid is to act as a guideline for the user when lining up objects. Everything works just fine with one exception. Whe...
I'm trying to make an audio-sensitive animation, and for that purpose, I'm looking for a way to look up the current audio level. I'm looking for the peak within a set amount of time. (Think the red bar that stays on for a second or so, on an audio meter.)
I've searched around for for something like this, and the only thing I could find ...
I am parsing a CSV file when my iphone app loads. This takes a few seconds I would like to throw up a splash screen while this is happening however because I am loading this data from wakeFromNib the splash screen is coming up after I am done.
So where should I do this work?
...