Hi Everyone:
I am wondering if there is some way that I can create a timer that countdown from a given time. For example, say I want this timer to last an hour. There will be a NSTextField that will show the time remaining (ex. 25 minutes), and will auto update every minute to the new value. And then, when an hour is finally passed, ...
I'm seeing some quirky behaviour with Cocoa's KVC/KVO and bindings. I have an NSArrayController object, with its 'content' bound to an NSMutableArray, and I have a controller registered as an observer of the arrangedObjects property on the NSArrayController. With this setup, I expect to receive a KVO notification every time the array is ...
I have a NSString and I want to write its value to a NSMutableString. Is this valid:
NSString *temp = [NSString stringWithString:@"test"];
NSMutableString *mutable = temp;
I ask because although this seems doable, I would think that this would assign both temp and mutable to the same address space. I have this question a lot when pa...
I have a core data application based on the default xcode template, I have the main UI which is used for viewing the data and then I have a background thread which is downloading/inserting/editing data.
I figured when the application launches I can create two NSManagedObjectContext, one which the applications reads from and the other in...
How would I be able to open files from my application? For example, they type in the directory in a textfield called "inputBox" and they press the button open, to open the file.
Thanks
Kevin
...
Hello people!
I was wondering where is the best place to initialize members of the singleton class.
I'm using Apple fundamental guide singleton implementation. Could you please pinpoint at what line the inits happen? The code is the following:
static MyGizmoClass *sharedGizmoManager = nil;
+ (MyGizmoClass*)sharedManager
{
@synchr...
I have been reading up on File's Owner here on Stack Overflow and a few other resources, but I was left with one question. When do I not need a File's Owner for a nib? In chapter 8 of Exploring the iPhone SDK (a great book by the way) you design a table view cell nib. The author says the following:
You might be wondering why we're not d...
I've downloaded the JSON framework DMG from http://code.google.com/p/json-framework/downloads/list. I followed Option 3 here: http://code.google.com/p/json-framework/wiki/InstallationInstructions. For the copy files build phase, I set path to ~/Library/Frameworks/JSON.framework. Buid failed. I then tried setting it to my project root....
Heyho!
I've a little app running as LSUIElement with a NSStatusItem.
Sometimes the popupmenu's menuitems are updated by the code. But when the updated NSMenuItem (or its supermenu) is "highlighted" the app crashes without logging something.
Do you have any idea? Thank you very much for your answers.
...
I have an NSView subclass that can be dragged around in its superview. I move the views by calling NSView's setFrameOrigin and setFrameRotation methods in my mouseDragged event handler. The views are both moved and rotated with each call.
I have multiple instances of these views contained by a single superview. The problem I'm having is...
How would I make an NSTableView display an RSS Feed (just one)?
I think it would have something to do with NSURL and Setting the Table Views Data Source.
But how exactly would I do this?
...
I would need something this owner drawn tab completition key equivalents in my own code. Like TextMate does in this example.
I heared that the menu drawing is Carbon based but I don't hope it is such a huge hack.
But whatever I tried and wherever I looked I couldn't find a clue.
EDIT:
I'm willing to accept even a carbon based answer,...
I want to compare if an variable A represents the same object as variable B does.
Could I do that with the == operator?
Or what else is this exactly looking at? I think I need to check for the memory adress of the object where the variable is pointing to, right?
...
Hi,
I have a shell script stored in the resources folder of my Cocoa app. If used improperly it could be dangerous (even though I have taken precautions to reduce exploits, such as using the absolute path to commands) so is there any way to encrypt the script in binary format, then decrypt it when it needs to be used?
Thanks
...
Hi,
I have a shell script logging a list of numbers (1, 2, and so forth, one per line) to a log file. I need my ObjC app to read the log file every X seconds and then update my progress bar accordingly based on the last number logged in the log file.
What's the best way to do this?
...
I was trying to answer another question about the == operator and I created this code:
NSString *aString = @"Hello";
NSString *bString = aString;
NSString *cString = @"Hello";
if (aString == bString)
NSLog(@"CHECK 1");
if (bString == cString)
NSLog(@"CHECK 2");
if ([aString isEqual:bString])
NSLog(@"CHECK 3");
if ([aString isEqua...
In my Xcode App there is no Cocoa Touch. How do I fix that? What am I missing?
...
I have a custom NSView subclass that I want to animate with Core Animation. I am already (without CA) setting the position and rotation of these views with NSView's setFrameOrigin and setFrameRotation methods. However, no matter what I do, once I add a layer backing to the views I can't get them to rotate.
I've tried using NSView's setF...
Hi,
in my Cocoa application, I load a .jpg file from disk, manipulate it. Now it needs to be written to disk as a .png file. How can you do that?
Thanks for your help!
...
Can the tint color of an NSLevelIndicator be changed at all? (setTintColor doesn't work)
...