What do we mean by an Object "sending messages" and how do protocols help an object to advertise the messages it supports? Does anyone have an example?
...
Hi all,
I have made a sample application in which I am able to implement help book via help viewer .
Right now it is storing and displaying content from application bundle, but I want to implement Internet Primary help book content, in which it checks the server to determine whether a newer version of each page is available before dis...
My application usually only takes up ~40M of memory but when CoreText is used VSIZE jumps up to ~300M. How can I get CoreText to use less memory?
P.S. : I use lots of CoreText objects.
P.S. 2 : I use 'top' to get memory info.
...
These two code snippets produce files with different file-permissions. Example 1 creates the expected default file-permissions but Example 2 does not. What's the explanation for this?
OS: Mac OS X version: 10.6.4
Xcode version: 3.2.2, 64 bit
// Example 1
FILE *fh1 = fopen("Test1.txt", "w+x");
if (fh1) {
fwrite("TEST1", 1, 5, fh...
New to Cocoa, and seem to be missing something.
What is the most elegant/idiomatic way to obtain the first x elements of an NSArray as another NSArray? Obviously I can iterate through them and store them manually, but it seems like there has to be a more standard method of doing this.
I was expecting there to be an -arrayWithObjec...
I am using UIWebView in my application. I would like to have some hyperlinks to call methods in the Objective-C app. Is it possible? How?
...
Hi,
How can I set my fetchedResultsController.sortDescriptors to contain a sortdescriptor that uses a keypath, for instance, such as @"foo.name"?
Cheers
Nik
...
Hi there. I'm trying to get a row in my table view to resize its height, but the delegate method:
- (CGFloat) tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row
is never called. I have implemented other delegate methods and they work perfectly.
Is there something I am not doing?
Thank you!
...
Does NSNotificationCenter use pointer equality or some other criteria (like isEqual: or hash:) to determine whether a notification should be sent to an observer?
...
Hello All,
I am having an issue that is perplexing me. I have a NSMatrix using NSButtonCells to display a series of checkboxes. Because the Text is RTF I have to set AttributedTitle instead of Title. But even with wordwrap set to true it will only wrap Title and never does it to AttribtuedTitle.
Has anyone out there ever dealt with thi...
Is this method supposed to take a path as its argument?
It looks like it takes a filename as a path:
For example, /home/file.txt is a file, while /home/ is a path. This method looks like it takes the former as an argument.
...
Hi there.
I'm doing something with cocoa which I think is a bit complicate for a beginner like me. I tried a few things, but I admit I need some theory first, because I would like to understand exactly the meaning of this concepts.
I see that every NSView and every class that subclasses it has one thing called frame, and one called bou...
I'm attempting to write an app that can arrange timed playback of some (mostly tiny) audio files. The catch: it needs to be timed with accuracy worthy of music. The sounds won't be played frequently (it's not, for example, a sampler or a drum kit), but they will need to be absolutely precisely placed. There are two parts to this question...
The setup: I have a singleton data access manager object, call it Manager. I also have some view controllers, call them Apples and Oranges. Both Apples and Oranges use Manager for some shared data model/access functionality.
I would like Manager to call either of them back in certain cases according to something like this:
if (someCond...
I have this code in a cocoa application to resize a PNG file to a certain dimension but I want the format to be still a PNG, but there is no PNGRepresentation method for NSImage.
How do I do this?
NSData *sourceData = [NSData dataWithContentsOfFile:fileName];
NSImage *sourceImage = [[NSImage alloc] initWithData: sourceData];
NSSize or...
Just experimenting with @property and @synthesize:
@interface Greeter : NSObject
//{
// NSString * name;
//}
@property (assign) NSString * name;
- (NSString *) greeting;
@end
It seems to be the case that if you declare a variable using @property that you don't have to declare it between the braces (and you don't even need the brace...
I'm using CGEventCreateKeyboardEvent to create and CGEventPost to post an event on the Mac. The following code works perfectly for pressing the 'a' key.
CGEventRef downEvent = CGEventCreateKeyboardEvent(NULL, 0, YES);
CGEventPost(kCGHIDEventTap, downEvent);
CFRelease(downEvent);
The problem lies in the fact that the user might have a ...
Can someone point out a comprehensive example on Image processing using cocoa API? I am developing an application for the Mac, and not for the iphone device. I usually come across with UIImage manipulation which provides an intuitive set of methods to achieve task such as per pixel manipulation and saving into file at different format. I...
What is the purpose of setting things to nil in the viewDidUnload() method? I know it has something to do with releasing memory, but I thought that's what release was for in the dealloca() method. How do you know which things to put in viewDidUnload() to set to nil?
...
I want to "simulate" a multi-touch event for another application, e.g., simulate a zoom-in gesture on iPhoto. I searched many sources but can't find an answer for that.
It seems the most common way to sending an event to other application is with script bridge, getting a SBApplication and then send an AppleEvent. But it seems the genera...