I have an NSString I'm working with, but I would like to parse it by character length. So break it apart into an NSArray, and have each object in the array be x characters from that string. So basically, break up the string into sub strings of a certain length
So, how do I do it?
example:
NSString *string = @"Here is my string"
NS...
I was wondering if anyone could tell me if there is a method in Cocoa that will display information (images) on screen when a button is pressed. What I mean is NSLog "prints text" to the console is there a method that displays images just as easily like would -(void)drawView do it? Is it just setNeedsDisplay? I hope this makes sense. I a...
PackageMaker's Project menu contains an "Overwrite Project Package" option.
I can't find any documentation of this option, nor any references to it online.
Does anybody know what its function is?
...
Hello
I'm new to programming desktop applications for Mac (though a have a small experience with programming for IPhone).
Suppose I create a new Cocoa project in XCode.
This application does nothing just shows its window. I click on the cross in the red circle and my app minimizes to the dock and it has a blue dot on its icon showing t...
Is it possible to modify an NSDatePicker object to allow for 0 values in the month and/or day columns? Dealing with a situation where the specific day in particular is non-essiential but nice to have data (and data which the user likely doesn't know offhand to begin with).
...
Hi everyone.
I'm now creating an Application using speech recognition.To check the Audio Power coming in through the microphone,
I wrote a method as follows.
-(void)checkPower(AudioqueRef)queue{
UInt32 expectedSize= sizeof(AudioQueueLevelMeterState);
AudioQueueGetProperty(queue,
kAudioQueueProperty_CurrentLev...
Hi,
I am having big trouble to communicate through USB, from a Mac to an external HID device. The hardware has been proven fine when running under the Windows XP platform, but I can't find a GOOD exemple of programming the HID with Cocoa / objective-C. Several exemples are available in the Apple center, but they are either poorly docume...
Currently I understand it as a kind of "empty object". But what's it really?
...
I am trying to write a program that requires to know if a window is being dragged (moved around). The catch is that it's not the program's window, but rather any window in the OS (eg. Safari, iTunes, Adium, TextMate, etc.), and what program it belongs to
I was thinking AppleScript would be a potential way to do this, but there doesn't s...
Hi,
I've created a Objective-C class to interface with PostgreSQL using libpq. It mostly works but I have one small problem - the connection seems to disappear randomly.
This class is set to open a connection when a window is opened and close that connection before the window closes. On the init code of the window I open the connection...
I try to get the hang of it, but for now both seem the same thing to me. However, Xcode allows to create an Console App with choice of using "Core Foundation" or just "Foundation". Maybe someone can point out the differences.
...
I am trying to write a simple table view editor for a Core Data entity. Unfortunately I'm running into problems.
The error occurs when adding the very first entity to the table. The process for bringing up the modal dialog is as follows:
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext];
NSEntityDescript...
Hi,
I have a question about sorting NSMutableArray. I can use sortedArrayUsingDescriptors: method to sort an array with objects.
For example I have an NSMutableArray of places where I have an attribute frequency (int value) and I want to sort descending on frequency but I don't now if I how to use it correctly.
What do I put as a k...
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:3];
if ([arr isMemberOfClass:[NSMutableArray class]]) {
NSLog(@"YEP!!");
} else {
NSLog(@"NO!!");
}
I get always "NO!!" in console. I tried with Array, NSNumber, NSString. All of them don't seem to work. That's strange. As I get it from the docs, this method should return...
I was reading that NSArray is just such a thing. Sounds heavy. I have 7 really fat books here on my desk about Objective-C, Cocoa and C. None of them mention Class Cluster at all, at least I can't find it in the Index at the back of the books. So what's that?
...
I'm familiar with how to feed data from one Core Data entity into an NSPopUpButton item so that it can be selected for another. Bindings like so:
For the values themselves:
-> ValueSelection.Content
Bind To: Value Source Entity
Controller Key: arrangedObjects
Model Key: N/A
For the values displayed in the NSPopUpButton:
...
From the command prompt it's possible to run for example "open http://www.example.com" and have that homepage displayed in the default browser.
Similarly you can run "open callto:xyz123" to open up a skype-call to user xyz123.
I'd like to do the same with a customized web browser without replacing the default web browser. My idea is t...
Hello,
I'm working with a GPS module that is transferring data to my mac over a serial RS232-to-USB interface. I've written a objC program that takes the raw data and converts it into meaningful information.
Using a program called goSerial, I'm able to log all incoming data into a text file. I have been able to make my program read the...
How can I set the default font of an NSTextView component? I need to have an area in my app where users can make changes to a plain text file, and I'd like for the font to be a monospaced font.
...
When you scroll with the newer Apple Magic Mouse (at least on 10.6, I can't confirm any previous Mac OS) you get inertial scroll like scrolling on iPhone (that is, after a flick of the finger to scroll, it doesn't abruptly stop, but instead gradually slows down). This behaviour is "for free" with all NSScrollViews, it would appear.
Ther...