I have hundreds of thousands of points of time series data that I want to represent to the user. My current solution is to render said data to a PNG with a 3rd party library and then load that PNG into a NSImage and display it in a scroll view. This works great, except that:
NSImages more than 32k pixels wide don't display properly
...
Hi,
how to set iPhone device to stay active ( to not lock ) while my app is running ?
Any idea
...
How do I get an NSString from console input, and then try to cast it into an int?
...
I'm new to Objective-C and iPhone development, and I'm trying to store floating-point values in an NSMutableArray, but when I do I get an error saying "incompatible type for argument 1 of 'addObject". What am I doing wrong? I'm trying to create an array of doubles that I can perform math calculations with.
...
Now this must be easy, but how can sum two NSNumber? Is like:
[one floatValue] + [two floatValue]
or exist a better way?
...
I'm trying to work out the "correct" way to handle populating an array with key-value coding for an iPhone app. I've come up with something that works, but it's fairly hackish. Basically I'm parsing an XML document into a set of code-generated models. Let's assume the XML is of this format:
<foo>
<bar>
<item name="baz" />...
Why is the Objective-C object type called 'id'? As opposed to, say, 'object'?
...
I seem to enjoy designing new UIViews and UIControls that implement their own:
- (void)drawRect:(CGRect)rect;
function. This work well for me, especially when composed using UIViews in Interface Builder.
But composing them in Interface Builder is annoying because they just show up as boring rects with backgroundColors. Boring.
It wo...
I've here a CoreData app (no document-based), 1 entity and 1 tableview for edit/add/remove "instances" of the entity. Now I can manual add and save but I would like to
a) save automaticly changes
b) add automaticly some "instances" with the first start.
I think a) can be solved with NSNotifications. But which to use by entities?
...
If I have a class that has a sharedInstance of itself (singleton pattern) or a shared instance of another class, how do I make sure that shared instance is released properly when my program exits? Better yet, can you point me to some documentation about this?
sample class (with all other methods removed for clarity):
@interface Foo : N...
I've got an app in development where you press a button to play a sound using System beep.
Instead of recording the output, I was thinking of recording the timing of when the buttons were pressed, so when the user presses a 'Play' button, the buttons are pressed in the same timing the user has pressed them, so it acts like the iPhone ha...
I have a list of things in a table view.
When a user tap a row, I increase score. I wish provide a way to clear the score for that row.
My first try is put the table in edit mode, show the delete button to that row and proceed. However, all the other rows get blocked and can't tap again the score or tap in the disclosure button.
So, o...
I want to build a custom control to reuse in my project which consists of two UITextFields that are linked together + a label.
It is starting to become repetitive across my App and smells of code duplication ;)
However, I wonder what is the best aproach here.
Is it best do everything by code in a controller or is posible do a visual ...
For some crazy reason I can't find a way to get a list of files with a glob for a given directory.
I'm currently stuck with something along the lines of:
NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
NSArray *dirContents = [[NSFileManager defaultManager]
directoryContentsAtPath:bundleRoot];
..and...
I'm using garbage collection in Objective-C 2.0. Do I need to retain properties? Eg.
@property (nonatomic, retain) NSMutableArray *myArray;
Or is this enough:
@property (nonatomic) NSMutableArray *myArray;
I initialize the array like this:
self.myArray = [NSMutableArray array];
...
I wonder if exist a pre-made objective-c library to work with paypal, including with credit-cards.
My google search not get returns (I look for objective-c paypal)
Also, if exist other librarys for common gateways....
...
I'm teaching myself Objective-C and I noticed in a lot of books and examples the use of 'k' and camel-casing in constant definition, e.g.
#define kMyConstant 0
What is the significance of the 'k'?
Is this unique to Objective-C style, or common to C in general?
Why the deviation from (what I've always thought as a best practice) K_MY...
Some applications, like Photoshop, allow users to drag a picture from a web browser, or drag a file from the filesystem, onto the application's icon in the dock. Doing this opens the file in that application.
How is this done? I'd like to use Cocoa and Objective-C, but I'm interested in any solutions in any languages.
...
I have a cocoa class set up that I want to use to connect to a RESTful web service I'm building. I have decided to use HTTP Basic Authentication on my PHP backend like so…
<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
//Stuff that users...
I have a menu that let's a user select a country. Exactly like that in the contacts.app country menu within the address field.
Does anyone know a simple way of getting a list of countries? I have used NSLocale to generate an array of countries but it's only the country codes unfortunately and not the human readable equivalent. I don't ...