I use Doxygen to generate docs for my objective c code. Up to now though, I haven't been able to find any guidelines for how to correctly document properties. Examples I've looked at do it every conceivable way. Some people document the variables themselves, some people document the @property declarations. Some use //, while others u...
Is there a way to prevent a NSDrawer from being resized? I've tried setting the Min and Max content size to the same value and no luck.
...
I'm writing a mozilla plugin on the mac. I'm trying to capture events like button clicks, etc. I've done the normal thing of creating my views in inteface builder, and linking the sentActions to methods in my program. This works in stand-alone programs.
However, in my NPAPI plugin, those methods never get called. The button reacts, depr...
I am currently working through the famous "Cocoa Programming for OSX" by Aaron Hillegaas.
In Chapter 12 he wants me to create an about window using
[BOOL] successful = [NSBundle loadNibNamed:@"About" owner:self];
which, by itself, works perfectly well. However, I am using the garbage collector and since I do not retain a pointer to t...
I am building a game similar to mastermind for the iPhone and I am needed to compare two strings character by character. I need to choose a string from the database and compare it with the string entered by the player.
I have tried the following but it does not seem to work. Can you please help me.
//create file handle
NSFileHandle *fi...
Hello,
I want to add a title to my graph that gives a short description or name about the plot. For example, I have a table with a list of products and my graph shows how much those products cost. There should be a label/annotation superimposed on the graph that gives the name of the product.
...
Using Apple's Mail application as an example; pretend it uses Core Data. When you touch an email account, it shows you all the messages in that account. So the controller did a fetch request for all the messages in that account.
Then you touch a message and drill one level deeper, now you are viewing a single message. This single messag...
I am writing a basic image processing app. Right now I have code in place to load an image via the Camera or the image picker and set it as the source image for a UIImageView object in my interface. The object is configured with the "Aspect Fill" property, so I don't have to programmatically crop the image.
Looking at the sample code pr...
I have:
typedef float DuglaType[3];
@interface Foo : NSObject {
DuglaType _duglaType;
}
How do I correctly declare the property?
I tried:
// .h
@property DuglaType duglaType;
// .m
@synthesize duglaType = _duglaType;
But this spews errors.
What is the secret handshake for C++ typedefs to play nice with Obj-C properties? Tha...
Hello,
I have a NSScrollView with a custom view inside and when I resize the NSScrollView, the height grows and it scrolls upward. Unless there is an easier way, I'll probably have to register a notification to see if the view changes size and then adjust the scrollPoint: to a new point. I'm having trouble getting method to work smoot...
I have created a java server, which takes screenshots, resizes them, and sends them over TCP/IP to my iPhone application. The application then uses NSInputStream to collect the incoming image data, create an NSMutableData instance with the byte buffer, and then create a UIImage object to display on the iPhone. Screenshare, essentially....
I would like to add a vertical slider to my cocoa menulet application. Just like the vertical slider in the system volume menulet. How do I add this using Interface Builder? And if not with Interface Builder then how?
...
NSNumberFormatter * fmt;
NSNumber * n;
fmt = [ [ NSNumberFormatter alloc ] init ];
n = [ NSNumber numberWithFloat: 10 ];
[ fmt setFormatterBehavior: NSNumberFormatterBehavior10_4 ];
[ fmt setCurrencySymbol: @"$" ];
[ fmt setNumberStyle: NSNumberFormatterCurrencyStyle ];
// NSLog( @"%@", [ fmt stringFromNumber: n ];
[ fmt ...
In my program I have two classes: Collector and Entity. Collector stores Entities in NSMutableArray.
@interface Entity : NSObject {
...
}
@interface Collector : NSObject {
NSMutableArray *entities;
uint someInt;
...
}
- (void)addEntity:(Entity*)newEntity; // implemented as [entities addObject:newEntity];
Collectors ...
I am an Objective C newbie and I'm sure this is an easy question but I can't figure this out:
I have a class which declares an instance variable called myDeck, which is part of a custom class I created called Deck. Right now I have this in my code:
In the @interface:
Deck *myDeck;
In my init method:
Deck *ourDeck = [[Deck alloc]init...
Hi,
When I call the method setStringValue: mCurrentString when </Text> is encountered, the child elements which are already attached to the element are detached. Can any one suggest why it is happening so.
The sample XML file goes like this:
<?xml version="1.0" encoding="UTF-8"?>
<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...
Hi there,
I want to create a "blind down" effect on an image so the image "blinds down" and appears.
Sort of like this JavaScript transition:
http://wiki.github.com/madrobby/scriptaculous/effect-blinddown
The mask is setup correctly because if I manually change it's position it hides and reveals the image behind it, but it doesn't ani...
I have a number of Objective-C classes organized in an inheritance hierarchy. They all share a common parent which implements all the behaviors shared among the children. Each child class defines a few methods that make it work, and the parent class raises an exception for the methods designed to be implemented/overridden by its children...
I have a method that creates a local textfield and pops up the keyboard ( of a given type ) to fill the field. I call this 4 times each following the input done event of the previous.
The first time i call it with the default keyboard and the following three are with the UIKeyBoardTypeNumbersAndPunctuation keyboard. The weird thing is ...
This is unmodified code from Apple's iPhone 'Utility Aplication' template:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
MainViewController *aController = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil];
self.mainViewController = aController;
[aController release];
mainViewController.view...