I've put a table on the flipside of my Utility Application template. The template automatically puts a titlebar with a done button to go back to the front view.
When one of the cells in the flipside's table is selected, it brings up the Camera / Image Library picker. But it leaves the titlebar is position, partially obscuring the picker...
Hello,
I have some product photos, from which I would like to remove the white background.
An example:
Is there a nice library or a manual way to do it with Cocoa or C?
For which keywords (image processing methods) do I have to search?
...
Hello,
I'm trying to get a small twitter client running and I ran into a problem when testing API calls that require authentication.
My password has special characters in it, so when I try to use the following code it doesn't work.
NSString *post = [NSString stringWithFormat:@"status=%@", [status stringByAddingPercentEscapesUsingEncod...
I have created a Sub-Class of NSOutlineView and used the below code to make the row colors alternate.
Header File.
#import <Cocoa/Cocoa.h>
@interface MyOutlineView : NSOutlineView {
}
- (void) drawStripesInRect:(NSRect)clipRect;
@end
Implementation File.
#import "MyOutlineView.h"
// RGB values for stripe color (light blue)
#def...
I just spent the last 3 hours trying to figure out this error. I would like someone to explain it to me so I don't do it again.
I assigned an NSString instance variable without using "self". When the class ("self") released, I received a "bad access" error. I have done this exact same thing in another class with the same variable dec...
I have some code to do this (which is below) but I get one error stopping it from working and the error is ''MyOutlineView' may not respond to '-objectArray'', it says that it needs to be declared but I don't know what code I should use in the Header File to declare it.
The Code:
- (void) outlineView: (NSOutlineView *) aView
willDispla...
I am trying to pull some data from a server (I don't own the server) however it returns some needed data with a http 500 error code, however NSString stringWithContentsOfURL returns nil if the server returns http code 500.
I'd like to retrieve the data even if the server returns 500.
...
I'm working on an application that holds its data in an external MySQL server, but caches it locally using Core Data for better response times. Basically, what I'd like to do is this:
Fetch data from Core Data (SQLite data store, using NSFetchedResultsController) and display it
Grab new items from the MySQL server in the background
Ref...
Using LINQ in .Net I can select items from an array that match a particular criteria i.e. from an array called People:
var cleverPeople = People.Where(o=>o.IQ>110);
Is there anything similar I can do to an NSMutableArray? I have many items in it and enumerating it with a loop is pretty costly performance wise.
...
Hi Guys,
Here is how the page should look like:
It should have the following functionality:
- By clicking the period on segmented control start date gets the value of present time - the interva and end date gets the value of the present time.
- By selecting one of the labels Start/End, you are able to change their date with date pi...
I think Xcode is a good IDE, but having used Eclipse for Java development in the past I am quite underwhelmed by XCode's code completion and error/warning feedback. (Most of the time, XCode seems to simply try to match the beginning of a text fragment to "words" in the same document, without even using type information to try to determin...
I have a NSString that I need to examine character by character and:
examine char
perform calculation
loop (until string ends)
Any thoughts on the best way to do this? Do I need to convert the NSString
to a NSArray or C string?
...
Occasionally, it's useful to set up method dispatch table so calling method A calls AImpl() method while calling method A at another time calls BImpl(). How can this be done in Objective-C for a method that's automatically called by the system (e.g. delegate methods)?
For example, if the sytem calls viewDidAppear for the first time, I ...
Instead of implementing my own I was wondering if anyone knows of a histogram or bag datastructure implementation in Objective-C that I can use.
Essentially a histogram is a hashmap of lists where the lists contain values that relate to their hash entry. A good example is a histogram of supermarket items where you place each group of it...
How are unicode comparisons coded? I need to test exactly as below, checking for specific letters in a string. The code below chokes: warning: comparison between pointer and integer
for (charIndex = 0; charIndex < [myString length]; charIndex++)
{
unichar testChar = [myString characterAtIndex:charIndex];
if (testChar == "A")
...
I'm getting my feet wet in Objective-C and Cocoa (I know, probably late, but hey I have to start somewhere) and I noticed that all objects are allocated out of the heap.
Is there any reason why this is the standard in Objective-C? I tried looked everywhere (and yes, even on StackOverflow), but I couldn't find any explicit reason, except...
Is there a way to get an NSDictionary back from the string created via its description method?
Given this code:
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"value 1", @"value 2", nil] forKeys:[NSArray arrayWithObjects:@"key 1", @"key 2", nil]];
NSString *dictionaryString = [dictionary descr...
I.e., does ObjectiveC behave like C, in that if you create a pointer eg:
NSString* c;
Does c point to nil, or to the random value in the memory area that was reserved for it?
In other words, do pointers get pre-initialized, or do I need to do that myself? As I said, I'm aware this is not the case in C/C++, but I'm wondering if ther...
Hello.
I'm trying to load a file into a string. Here is the code I'm using:
NSError *error = nil;
NSString *fullPath = [[NSBundle mainBundle] pathForResource:filename ofType:@"html"];
NSString *text = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:&error];
When passed in @"about" as the filename, it w...
Normally i've been passing variable around in init methods, but I can't do that this time because I have a var in one ViewController class displayed using a tab bar and I need access to it from a different ViewController class when a different tab bar is pressed. My understanding was that you can access vars using @property but it's now ...