I've only recently noticed a crash in one of my apps when an object tried to message its delegate and the delegate had already been released.
At the moment, just before calling any delegate methods, I run this check:
if (delegate && [delegate respondsToSelector:...]){
[delegate ...];
}
But obviously this doesn't account for if the...
I'm developing a Cocoa desktop application that uses a source list in the style of iTunes: different elements in the source list cause the main content area to display different views.
The content area is entirely filled with a (vertical) NSSplitView; on the left is an NSOutlineView source list. When the user selects an item on the left...
I have a UITableViewCell that I create in tableView:cellForRowAtIndexPath:. In that method I call:
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
NSLog(@"Cell height: %f", cell.contentView.frame.size.height);
This gives me a return value of 44.000000.
Then...
Yet another iPhone/Objective-C noob question. I'm using a singleton to store app state information. I'm including the singleton in a Utilities class that holds it (and eventually other stuff). This utilities class is in turn included and used from various view controllers, etc. The utilities class is set up like this:
// Utilities.h...
Objective-C / Cocoa:
I need to load the image from a JPG file into a two dimensional array so that I can access each pixel. I am trying (unsuccessfully) to load the image into a NSBitmapImageRep. I have tried several variations on the following two lines of code:
NSString *filePath = [NSString stringWithFormat: @"%@%@",@"/Users/adam/D...
I have some sample code from Tuaw which is probably 3 releases old ;) The compiler is issuing a warning that the method is deprecated, but I do not see that mentioned in the SDK docs. If it is deprecated, there must be an alternative approach or replacement method. Does anyone know what the replacement is for this method?
The specifi...
Hi!
I'm actually developping an application for iPhone and I need to use a library, initially dedicated to a Linux environment. Since I'm using a Mac (with Snow Leopard and Intel Core Duo), I guess it's possible to use this library in my app.
My library has 3 files: a file .h, a file .a and a file .so (both .a and .so are in /Developer...
I have to show the custom license Agreement dialog to the user before they start using my application.So, i have added new window in my mainMenu.xib and showing that window modally using
[NSApp runModalForWindow:licenseWindow];
in applicationWillFinishLaunching: delegate by making my main window hidden using visible at Launch to unch...
Is there anyway to categorize photos in the photolibrary? I want to make different folders in my photolibrary like Friends,Family,US Trip,...etc.
...
Is it possible to change the color of the active tab on iPhone's tab bar?
By default it is blue and it is not working with my app's color scheme.
...
So I've got an IKBrowserView all wired up and happily dragging my custom datatype (provided lazily via PasteboardItem) from one window to another, but now I'm interested in detecting when the user drops some data onto the trashcan. Cocoa's documentation says to check the return type of the drag operation itself, but how exactly do I do t...
Hi,
in my app i need to open a website with the corresponding TLD for that country. Lets say google.com, google.de, etc...
But i don't know which country codes the're specifically using in NSLocale's dict. Can i assume that the lowercase version of NSLocaleCountryCode can be appended as TLD?
Regards, Erik
...
Hello,
If we have this code in our interface .h file:
@interface CarModelSelectViewController : UITableViewController {
NSString *fieldNameToStoreModel;
NSFetchedResultsController *fetchedResultsController;
NSManagedObjectContext *managedObjectContext;
DataEntered *dataEntered;
}
@property (nonatomic, retain) NSString *fieldNameTo...
I am grappling with adding an NSData object to a NSMutable array.
The code is executing fine but it is not adding the objects in the array.The code is as follows:
NSData * imageData = UIImageJPEGRepresentation(img, 1.0);
int i=0;
do{
if([[tempArray objectAtIndex:i] isEqual:imageData])
{
[tempArray remo...
I need to hide the file in finder as well as in spotlight if possible using objective-c or using C calls.
Thanks
...
One thing I have in mind is, that datasets in Core Data (or lets say: managed objects) have no ID like known from other databases such as MySQL. Also, they're not in a specific guaranteed order.
What else makes Core Data much more "special" compared to working with a relational database like MySQL? Besides the whole object graph persist...
I'm trying to animate a view sliding into view and bouncing once it hits the side of the screen.
A basic example of the slide I'm doing is as follows:
// The view is added with a rect making it off screen.
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.07];
[UI...
When you look at some Objective-C code, you often see class properties defined as non-atomic. Why? Does it give you some performance boost when you're not working with threads, or is there some other reason?
...
Is there a way to change the text color for entire webView?
If it is could you provide me with some examples?
...
I need to represent a linear process (think wizard) in an iPad app.
In principle I could use a UINavigationController and just keep pushing new controllers for each step of the process. But this seems rather inefficient since the process I'm modeling has no notion of navigating backwards so all previous views would pointlessly stay aro...