Hello,
I need to show a special menu when the dock icon is hovered. In order to do this I need to find a way to get the coordinate of the app icon in the dock.
Do you know how I can get this info?
Thanks and regards,
...
How can I optimise out this nested for loop?
The program should go through each word in the array created from the word text file, and if it's greater than 8 characters, add it to the goodWords array. But the caveat is that I only want the root word to be in the goodWords array, for example:
If greet is added to the array, I don't want...
I've set up a UISwipeGestureRecognizer:
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:delegate action:@selector(handleSwipeGesture:)];
swipe.direction = UISwipeGestureRecognizerDirectionUp;
[self addGestureRecognizer:swipe];
[swipe release];
A swipe makes the player move in the direction of the swi...
I have an objective-c class, which has a string ivar which I need to change when a callback function is called. The trouble is that the callback is in c++, and I therefore cannot access the ivars of the objective-c class in that c++ function. The callback must be in c++ that, cannot change. I realize that there are other ways this could ...
Hi I am a newbie to objective C and was wondering how I could form an NSDictionary with the following structure.
level 1
level attribute 1.1 - level score - level percent
level attribute 1.2 - level score - level percent
level attribute 1.3 - level score - level percent
level 2
level attribute 2.1 - level score - level ...
Hello,
I am looking for a high performance inter process communication system in macos X.
What is the best system? AppleEvents or NSNotifications?
Thanks :)
...
Hello, I have been reading about bit operators in Objective-C in Kochan's book, "Programming in Objective-C".
I am VERY confused about this part, although I have really understood most everything else presented to me thus far.
Here is a quote from the book:
The Bitwise AND Operator
Bitwise ANDing is frequently used for masking operat...
Hi There,
Basically, here is my view hierarchy (and I appologize if this is hard to read... I'm new here so posting suggestions happily accepted)
--AppControls.xib
-------(UIView)ControlsView
----------------- (UIView)TopBar
----------------- -------------- btn1, btn2, btn3
----------------- UIView)BottomBar
----------------- -...
I'm looking for a smart way to remove a subview (with removeFromSuperview) when the subview itself (or precisely said one of its components) triggered the removal. As for the source code this would be like
UIView * sub_view = [[[UIView alloc] initWith...
UIButton *button = [UIButton buttonWithType...
[sub_view addSubview:button];
[se...
This is a bit complex.
I've created an array (NSArray) called pointsOfInterest.
The elements of this array are NSDictionary objects. Each dictionary has two keys, "headerTitle" and "rowObjects." The value for "headerTitle" is a simple NSString; the object for "rowObjects" is another NSArray of objects; each of these is a custom class.
...
Hi,
I'm using a MapView.
It works fine on the simulator but when I test on a device, the map doesn't seem to load. (or does load but takes a very long time sometime).
All I do to use the MapView is just grabbing an instance on MapView and put it in the view through Interface Builder.
Is there anyway I can do to force the map to load?
...
Hi, noob here wants to calculate compound interest on iPhone.
float principal;
float rate;
int compoundPerYear;
int years;
float amount;
formula should be: amount = principal*(1+rate/compoundPerYear)^(rate*years)
I get slightly incorrect answer with:
amount = principal*pow((1+(rate/compoundPerYear)), (compoundPerYear*years));
I'm...
If i create a simple class like this
@interface table : NSObject {
NSMutableArray *array;
}
@end
and in the Init method I call: array = [[NSMUtableArray alloc] init];
and in the dealloc method I call: [array release];
but I have a memory leek because the dealloc method is never called. I must call the dealloc method by myself?
...
Hi,
How can I draw lines between 2 pins on the MapView?
Thanks,
Tee
...
Why when I code I can do:
NSString *test;
test = @"stack";
test = @"overflow";
without any problems, NSString is not supposed to be immutable?
...
All I want is an integer which everytime my app opens is incremented by one. Is there an easy way to do this? Please help.
Thanks, in advance.
...
if (win) {
// Game was won, set completed in puzzle and time
// Calculate seconds taken
int timeTaken = (int)([NSDate timeIntervalSinceReferenceDate] - self.gameStartTime);
int bestTime = [[self.puzzle valueForKey:@"bestTime"] intValue];
if (timeTaken < bestTime && bestTime != 0) {
[self.puzzle setValue:[N...
How can I make a button that says "Show Picture" and when it's clicked it changes to "Hide Picture". I'm new to objective C, I know how to make a button in interface builder but don't know how to switch the button's text and function. Can someone help me out?
...
Hi,
I want to save the filePath of an ImageAttachement in Core Data.
The method addNewImageAttachementWithFilePath creates a new ImageAttachement and registers this at Core Data.
Now I have the problem that the filepath is cut when the filepath of the imageAttachement is set.
- (void) addNewImageAttachmentWithFilePath:(NSString *)fil...
I'm trying to call an objective-C function from a C function but the code keeps crashing in objc_msgSend.
My objective-C class is a singleton and I'm using the following code.
void c_function(int arg0, const char *arg1)
{
[[objc_class instance] testFunction:arg0 Arg1:arg1];
}
The gdb shows the crash is happening when object...